#include <iostream> using namespace std; int main() { ?? ?int score,grade; ?? ?cout<<"输入一门课程的成绩:"<<endl; ?? ?/*cin>>score; ?? ?if (score>=90.0) ?? ? ? ?cout<<"A Grade"; ?? ?else if (score>=80.0) ?? ? ? ?cout<<"B Grade"; ?? ?else if (score>=70.0) ?? ??? ?cout<<"C Grade"; ?? ?else if (score>=60.0) ?? ??? ?cout<<"D Grade"; ?? ?else cout<<"Not Passed"<<endl;*/
?? ?cin>>score; ? ? grade=score/10; ?? ??? ?switch(grade) ?? ??? ? ?? ??? ?{ ?? ??? ?case 9:; case 10:cout<<"A Grade";break; ?? ??? ?case 8:cout<<"B Grade";break; ?? ??? ?case 7:cout<<"C Grade";break; ?? ??? ?case 6:cout<<"D Grade";break; defult:cout<<"Not Passed";}
}
|