- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- int z;
-
-
- cout<<"請輸入兩個數字電腦會幫您排列數字的大小"<<endl;
- cout<<"請輸入第一個數"<<endl;
- cin>>x;
- cout<<"請輸入第二個數"<<endl;
- cin>>z;
-
- if(x>z)
- {
- cout<<x<<">"<<z<<endl;
- }
- else if(x>z)
- {
- cout<<x<<">"<<z<<endl;
- }
- else if(z>x)
- {
- cout<<z<<">"<<x<<endl;
- }
- else if(z=x)
- {
- cout<<z<<"="<<x<<endl;
- }
-
- system("pause");
- return 0;
- }
複製代碼 |