为什么下面这个程序,在输入完名字之后,结果就一闪而过,我已经加了getchar了,好心人帮我解答一下呦!
#include<iostream>usingnamespacestd;intmain(){charname[21];cout<<"whatisyourname?";ci...
#include<iostream>
using namespace std;
int main()
{
char name[21];
cout << "what is your name?";
cin >> name;
cout << "Hi," << name << endl;
getchar();
return 0;
} 展开
using namespace std;
int main()
{
char name[21];
cout << "what is your name?";
cin >> name;
cout << "Hi," << name << endl;
getchar();
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询