有些名字有空格(例:George Washington),所以要用while(getline(cin, 變數名))
#include <iostream>using namespace std;int main(){ string a; while(getline(cin, a)){ cout<<"Hey"<<a<<endl; }}