猿问

求大神看看 怎么运行不了

/***************************************************************
编写一个c++程序,如下述输入事例所示的那样请求并显示信息:
what is your first name? Betty Sue
what is your last name? Yewe
what letter grade  do you deserve? B
what is your age? 22
Name:Yewe,Betty Sue
Grade:C
Age:22
注意:该程序应该接受的名字包含多个单词。另外,程序将向下调整成绩,
即向上调一个字母。假设用户请求A、B或C,所以不必担心D和F直接的空档。
******************************************************************/


#include<iostream>
using namespace std;


int main()
{
 cout << "what is your first name? " ;
 char first_name[200];
 cin >> first_name;


 cout << "what is your last name? " ;
 char last_name[100];
 cin >> last_name;


 cout << "what letter grade  do you deserve? " ;
 char letter;
 cin >> letter;


 int a = letter; //向下调整成绩
 a++;
 letter = a;


 cout << "what is your age? " ;
 int age;
 cin >> age;



 cout << "Name: " << last_name << "," << first_name << endl;
 cout << "Letter: " << letter << endl;
 cout << "Age: " << age << endl;


 system("pause");
}


你好多少钱
浏览 1278回答 1
1回答

慕运维1139315

 letter是字符类型,a是整形,a=letter是不行的 
随时随地看视频慕课网APP
我要回答