标签:
现在要写一个程序,实现给三个数排序的功能
20 7 33
7 20 33
1 #include<stdio.h> 2 int main( ) { 3 int a, b, c, t; 4 scanf("%d%d%d", &a, &b, &c); 5 if(a > b) {t = a; a = b; b = t;} 6 if(a > c) {t = a; a = c; c = t;} 7 if(b > c) {t = b; b = c; c = t;} 8 printf("%d %d %d\n",a, b, c); 9 return 0; 10 }
标签:
原文地址:http://www.cnblogs.com/tong69/p/5779214.html