- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a;
- int b;
-
- cout << "請輸入 a:";
- cin >> a;
- cout << "請輸入 b:";
- cin >> b;
-
- cout <<"a ="<< a << endl;
- cout <<"b ="<< b << endl;
- if (a > b)
- {
- cout <<"a 大於 b"<< endl;
- }
- if (a < b)
- {
- cout <<"a 小於 b"<< endl;
- }
- if (a == b)
- {
- cout <<"a 等於 b"<< endl;
- }
-
- system ("pause");
- return 0;
- }
複製代碼 |