零起点学算法17——比较2个数大小

版权声明:本代码由Dust编写,抄作业是不对的哟~ https://blog.csdn.net/qq_36286039/article/details/86554673

零起点学算法17——比较2个数大小

Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lld
 


Description

输入2个整数,按照从大到小输出

Input

2个整数n和m(多组测试数据)

Output

按照从大到小输出,中间用一个空格隔开(每组测试数据一行)

Sample Input

14 32
2 3

Sample Output

32 14
3 2

HINT

int is enough


题目分析:用if语句进行判断。简单题。


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

猜你喜欢

转载自blog.csdn.net/qq_36286039/article/details/86554673
今日推荐