文文和兩個同學最近喜歡在 ZeroJudge 上解題。有一天他們看到了孔子說的:「三人行必有我師焉。」就吵了起來,因為他們每個人都認為自己是三個人之中的「老師」。後來他們決定要比比看誰在 ZeroJudge 上的 AC 題數最多。
輸入說明 :
輸入只有一行,含有三個由空白所隔開的非負整數。
輸出說明 :
輸出這三個整數中最大的那一個。
範例輸入 :
35 26 48
範例輸出 :
48
程式碼 :
#include <stdio.h>
int main()
{
int b,c,max;
while(scanf(" %d %d %d",&max,&b,&c)==3)
{
if(max < b)
max = b;
if(max < c)
max = c;
printf("%d\n",max);
}
return 0;
}
http://zerojudge.tw/ShowProblem?problemid=d065
沒有留言:
張貼留言