- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a, b, c;
- cout<<"請輸入第一個數:";
- cin >> a;
- cout<<"請輸入第二個數:";
- cin >> b;
- cout<<"請輸入第三個數:";
- cin >> c;
- if(a>b && b>c)
- {
- cout<<a<<">"<<b<<">"<<c<<endl;
- }else if(a>c && c>b)
- {
- cout<<a<<">"<<c<<">"<<b<<endl;
- }else if(b>a && a>c)
- {
- cout<<b<<">"<<a<<">"<<c<<endl;
- }else if(b>c && b>a)
- {
- cout<<b<<">"<<c<<">"<<c<<endl;
- }else if(c>a && a>b)
- {
- cout<<c<<">"<<a<<">"<<c<<endl;
- }else if(a>b && b>c)
- {
- cout<<c<<">"<<b<<">"<<c<<endl;
- }else
- {
- cout<<"其中兩個數,或三個數箱等!"<<endl;
- }
- system ("pause");
- return 0;
- }
複製代碼 |