本帖最後由 蔡岳凌 於 2012-4-18 13:20 編輯
- #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) //&& ---> and
- {
- cout<<"甲等!"<<endl;
- }else if(score>=70 && score<=79)
- {
- cout<<" 乙等!"<<endl;
- }else if(score>=60 && score<=69)
- {
- cout<<" 丙等!!"<<endl;
- }else if(score>=0 && score<=59)
- {
- cout<<"丁等!!"<<endl;
- }else
- {
- cout<<"別玩了,再胡鬧我扁你!"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |