编辑:这是 If-Else。请看看发生了什么。如果答案错误,有人可以告诉我如何返回吗?比如,不正确的答案,重新输入?
使用命名空间标准;
int main()
{
cout<<"Welcome to the Grade Database. Please insert your domain: " ;
cout<<"\n";
int d, n;
cin>>d;
cout<<"Now enter your total grade(between 0-100): " ;
cin>>n;
if (n>0 && n<59){
cout<<"See you next year then :(" ;
cout<<"F-"<<n;}
else if (n<60 && n>=69){
cout<<"Well...you pass ;D" ;
cout<<"E-"<<n<<" ~"<<d;}
else if (n>70 && n<=79){
cout<<"Better than the average!";
cout<<"D-"<<n<<" ~"<<d ;}
else if (n>80 && n<=89){
cout<<"Very well sir!";
cout<<"C-"<<n<<" ~"<<d;}
else if (n>90 && n<=99){
cout<<"Wow, amazing! One of the best!";
cout<<"B-"<<n<<" ~"<<d;}
else if(n==100){
cout<<"Well, hello there Mr. Stephen Hawking.";
cout<<"A-"<<n<<" ~"<<d;}
else{
cout<<"Invalid Entry.";}
return 0;
}