您的位置:首页 > 编程语言 > C语言/C++

C语言实验——两个数比较

2017-11-17 11:41 239 查看
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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: