- #include<iostream>
- using namespace std;
- int main()
- {
- int score;
- cout<<"請輸入你的成績: ";
- cin>>score;
- cout<<"你的成績是"<<score<<"分"<<endl;
- if(score>=90 && score <=100)
- {
- cout<<"優等!!!"<<endl;
- }else if(score>=80 && score<90)
- {
- cout<<"甲等!!!"<<endl;
- }else if(score>=70 && score<80)
- {
- cout<<"乙等!!!"<<endl;
- }else if(score>=60 && score<70)
- {
- cout<<"丙等!!!"<<endl;
- }else
- {
- cout<<"丁等!!!"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |