程序运行到图片显示的那个地方就无法继续运行了,这里是源代码:
#includeiostream
#includestring.h
using namespace std;
int main()
{
char str[600];
char name[100];
char addr[200];
char work[200];
//获取3个字符串
cout\"enter your name and press ENTER:\";
cin.getline(name,99);
cout\"enter your address and press ENTER:\";
cin.getline(addr,199);
cout\"enter yourworkplace and press ENTER:\";
cin.getline(work,199);
//构建字符串并将其打印出来
strcpy(str,\"\\nMy name is\");
strcat(str,name);
strcat(str,\"\\nand I live at:\");
strcat(str,addr);
strcat(str,\"\\nand my work at\");
strcat(str,work);
coutstr;
return 0;
}
|