C++ 新手在 cout 尝试输出文本时遇到奇怪错误。这是我的代码有问题的区域:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string courseName, courseNum;
cout << "Enter a four letter course name: ";
cin >> courseName >> endl;
cout << "Enter a three digit course number: ";
cin >> courseNum >> endl:
return 0;
}
错误出现在以下几行中:
cout << "Enter a four letter course name: ";
和
cout << "Enter a three digit course number: ";
这里有什么问题?