- #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<=89)
- {
- cout<<"甲等"<<endl;
- }else if(score>=70 && score<=79)
- {
- cout<<"乙等"<<endl;
- }else if(score>=60 && score<=69)
- {
- cout<<"丙等"<<endl;
- }else if(score>=50 && score<=59)
- {
- cout<<"丁等"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼  |