- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int x;
- cout << "請輸入你的分數:" ;
- cin >> x;
- if( x == 100)
- {
- cout << "滿分" << endl;
- }
- else if( x >= 60 && x < 100)
- {
- cout << "及格" << endl;
- }
- else if( x >= 1 && x <= 60)
- {
- cout << "不及格" << endl;
- }
- else if( x == 0)
- {
- cout << "零分" << endl;
- }
- else
- {
- cout << "輸入錯誤" << endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |