#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"请输入一个整数:";
cin>>a;
cout<<a<<endl;
if(a>=0&&a<=100)
{
switch(a/10)
{
case 10:
case 9:
cout<<"等级A"<<endl;
break;
case 8:
cout<<"等级B"<<endl;
break;
case 7:
cout<<"等级C"<<endl;
break;
case 6:
cout<<"等级D"<<endl;
break;
default:
cout<<"不及格"<<endl;
break;
}
}
else
cout<<"输入错误"<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: