C语言实验——两个数比较
Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic
Problem Description
求2个数中较大者。
Input
第一行为测试的数据组数N,接下来的N行分别是两个待比较的整数。
Output
输出N行,每一行的值为每组数中较大的整数。
Example Input
2
1 2
15 10
Example Output
2
15
Hint
Author
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int t,a,b;
scanf("%d",&t);
while(t--)
{
scanf("%d %d",&a,&b);
if(a > b)printf("%d\n",a);
else printf("%d\n",b);
}
return 0;
}