Time Limit: 1000 ms Memory Limit: 65536 KiB
Problem Description
输入两个整数,请编程求其中的较大者。
Input
在一行中输入用空格隔开的两个整数,例如5 9。
Output
输出两个整数之中较大者,输出形式举例:max=9。
Sample Input
5 9
Sample Output
max=9
Hint
Source
wy
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b;
scanf ("%d%d",&a,&b);
if(a<b)
printf("max=%d\n",b);
else printf("max=%d\n",a);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,max;
scanf("%d%d",&a,&b);
if(a>b)
max = a;
else max = b;
printf ("max=%d\n",max);
return 0;
}
5 9
max=9
Process returned 0 (0x0) execution time : 1.621 s
Press any key to continue.