1 #include "stdafx.h"
 2 #include <iostream>
 3 using namespace std;
 4 
 5 int _tmain(int argc, _TCHAR* argv[])
 6 {
 7     int a,b,c;
 8     cin>>a;
 9     cin>>b;
10     cin>>c;
11 
12     if (a>b)
13     {
14         if (a>c)
15         {
16             if (b>c)
17                 cout<<"大到小排列为"<<a<<b<<c;
18             else
19                 cout<<"大到小排列为"<<a<<c<<b;
20         }
21         else
22             cout<<"大到小排列为"<<c<<a<<b;
23     }
24     else if (b>c)
25     {
26             if (a>c)
27                 cout<<"大到小排列为"<<b<<a<<c;
28             else
29                 cout<<"大到小排列为"<<b<<c<<a;            
30     }
31     else
32         cout<<"大到小排列为"<<c<<b<<a;    
33     cout<<endl;
34     
35     system("pause");
36     return 0;
37 }

 PS:本人连这都琢磨了很久很久,实在难以启齿,留这代码自己有用。

Rand Posts: