#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"输入两门课的成绩"<<endl;
cin>>a>>b;
switch((a>=0?a<=100?~0:0:0)&(b>=0?b<=100?~0:0:0)?a+b>=180?'a':a+b>=160?'b':a+b>=140?'c':a+b>=120?'d':'e':~0)
{
case 'a':
cout<<a+b<<"----〉A"<<endl;
break;
case 'b':
cout<<a+b<<"----〉B"<<endl;
break;
case 'c':
cout<<a+b<<"----〉C"<<endl;
break;
case 'd':
cout<<a+b<<"----〉D"<<endl;
break;
case 'e':
cout<<a+b<<"----〉E"<<endl;
break;
default:
cout<<"不是百分制成绩!"<<endl;
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"输入两门课的成绩"<<endl;
cin>>a>>b;
cout<<c<<"----〉"<<(c=a+b,(a>=0?a<=100?~0:0:0)&(b>=0?b<=100?~0:0:0)?c>=180?"A":c>=160?"B":c>=140?"C":c>=120?"D":"E":"\r不是百分制成绩!")<<endl;
return 0;
}
#include<iostream>
using namespace std;
int a,b=(cout<<"输入两门课的成绩"<<endl,cin>>a>>b,cout<<b<<"----〉"<<((a>=0?a<=100?~0:0:0)&(b>=0?b<=100?~0:0:0)?(b+=a)>=180?"A":b>=160?"B":b>=140?"C":b>=120?"D":"E":"\r不是百分制成绩!")<<endl,0);
void main(){}