我的 xcode 将编译但不允许我输入任何内容
#include <iostream>
using namespace std;
bool truthStatement;
int main (int argc, const char * argv[])
{
string name;
cout << "What is your name?" << endl;
cin >> name;
if (name == "Matt"){
cout << "You're cool" << endl;
} else {
cout << "You suck" << endl;
}
}
最佳答案
我以前遇到过这个问题。确保您使用的是 Return 键而不是键盘上的 Enter 键。
关于Xcode 不接受用户输入!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6164444/