#include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
cout << "Hello World!";
}
这行不通。为什么?
最佳答案
因为你忘了#include <string>
关于c++ - 为什么 cin >> string 不能与 Visual C++ 2010 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5343035/