本帖最後由 湯郡一 於 2018-8-2 10:37 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int a,b;
- cout<<"請輸入a"<<endl;
- cin>>a;
- cout<<"請輸入b"<<endl;
- cin>>b;
- cout<<"a="<<a<<endl;
- cout<<"b="<<b<<endl;
-
- if (a>b)
- {
- cout<<"a大於b";
- }
- else if (a<b)
- {
- cout<<"a小於b";
- }
- else
- {
- cout<<"a等於b";
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |