您的位置:首页 > 其它

将三个数按从大到小输出

2017-10-17 22:51 120 查看
#include<stdio.h>
#include <stdlib.h>
int main()
{
int a = 13;
int b = 9;
int c = 20;
int t;
if (a<b)
{
t = a;
a = b;
b = t;
}
if (a<c)
{
t = a;
a = c;
c = t;
}

if (b<c)
{
t = b;
b = c;
c = t;
}

printf("%d %d %d", a, b, c);
system("pause");
return 0;
}

运行结果:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: