将三个数按从大到小输出

来源:互联网 发布:中国洗脑 知乎 编辑:程序博客网 时间:2024/05/19 00:41
#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;}

运行结果: