游客 Signup | Login
中文 | En

1933 - 输入两个整数,输出他们的最大值

从键盘输入两个整数,输出他们中的最大值。

注:如两个数相等,刚输出他们中的任意一个值。

Input

输入包含一系列的a和b对,通过空格隔开。一对a和b占一行。

Output

对于输入的每对a和b,你需要依次输出a、b的最大值。

如对于输入中的第二对a和b,在输出中它们的最大值应该也在第二行。

Examples

Input

1 3
2 2
6 5

Output

3
2
6

Solution C

#include<stdio.h>
int main()
{
  int a,b;
  while(scanf("%d%d",&a,&b)!=EOF)
  {
    if(a>=b)
      printf("%d\n",a);
    else
      printf("%d\n",b);
  }
  return 0;
}

Solution C++

#include <stdio.h>
int main()
{  
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		if(a>=b)
			printf("%d\n",a);
		else
			printf("%d\n",b);
	}
	
		return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题