1 VS2012 2 3 //C语言实例 3个数由小到大排序 4 5 #include <stdio.h> 6 7 void main() 8 { 9 int a, b, c, t; 10 printf("Please input a,b,c; "); 11 scanf("%d%d%d", &a, &b, &c); 12 if (a > b) 13 { 14 t = a; 15 a = b; 16 b = t; 17 } 18 19 if (a > c) 20 { 21 t = a; 22 a = c; 23 c = t; 24 } 25 26 if (b > c) 27 { 28 t = b; 29 b = c; 30 c = t; 31 } 32 33 printf("The order of the number is: "); 34 printf("%d,%d,%d", a, b, c); 35 }