- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c;
- cout<<"請輸入第1個數"<<endl;
- cin>>a;
- cout<<"請輸入第2個數"<<endl;
- cin>>b;
- cout<<"請輸入第3個數"<<endl;
- cin>>c;
- if(a<b && a<c)
- {
- if(b<c)
- {
- cout<<a<<"<"<<b<<"<"<<c;
- }else
- {
- cout<<a<<"<"<<c<<"<"<<b;
- }
- }
- if(b<a && b<c)
- {
- if(a>c)
- {
- cout<<b<<"<"<<a<<"<"<<c;
- }else
- {
- cout<<b<<"<"<<c<<"<"<<a;
- }
- }
- if(c<a && c<b)
- {
- if(b>a)
- {
- cout<<c<<"<"<<b<<"<"<<a;
- }else
- {
- cout<<c<<"<"<<a<<"<"<<b;
- }
- }
-
-
- system("pause");
- return 0;
- }
複製代碼 |