- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int score =0;
- cout<<"請輸入你的成績:"<<endl;
- cin >> score;
- if(score >= 60 && score <=100) //&&同時成立 (and) ||其中一14個成立就過 (or)
- {
- cout << "及格" << endl;
- }
- else if(score >=0 && score <60)
- {
- cout << "不及格" << endl;
- }
- else
- {
- cout << "輸入錯誤" << endl;
- }
-
- system("pause");
- return 0;
- }
複製代碼 |