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;\n");
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:\n");
34         printf("%d,%d,%d", a, b, c);
35     }

C语言-实例3个数由小到大排序

相关文章:

  • 2021-07-19
  • 2022-12-23
  • 2021-09-29
  • 2021-09-27
  • 2022-02-11
  • 2022-01-21
  • 2021-07-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-11-27
  • 2021-11-11
  • 2021-08-14
  • 2022-12-23
相关资源
相似解决方案