nefuoj 11 寻找吕布

来源:互联网 发布:2017 php 不好找工作 编辑:程序博客网 时间:2024/04/30 06:28

寻找吕布

Problem:11

Time Limit:1000ms

Memory Limit:65536K

Description

三国里面吕布第一,赵云第二,典韦、关羽和马超分别是第3、第4和第5名,这是按武将的勇猛值和必杀技值的和来排名的,即武术值=勇猛值+必杀技值,下面给出这5人的勇猛值和必杀值,请你找出吕布的武术值。

Input

输入数据有多组,每组数据2行,第一行是5人的勇猛值,第二行是5人的必杀技值。勇猛值和必杀值是整数哦(32位)

Output

输出吕布的武术值。

Sample Input

1 2 3 4 51 2 3 4 520 21 22 45 871 100 8 99000 23

Sample Output

1099087

Hint

吕布的勇猛值和必杀技值都是第一的!

Source

陈宇
#include <stdio.h>#include <stdlib.h>int main(){    int i,temp,n=2;    int ym=0,bs=0;    while(scanf("%d",&temp)!=-1)    {        ym=0,bs=0;        if(ym<temp)        ym=temp;        for(i=1;i<=4;i++)       {            scanf("%d",&temp);            if(ym<temp) ym=temp;       }            for(i=1;i<=5;i++)       {            scanf("%d",&temp);            if(bs<temp) bs=temp;        }        printf("%d\n",bs+ym);    }    return 0;}
<br /><span id="_xhe_temp" width="0" height="0"><br /></span>

0 0