char g[10]; scanf("%s", g); printf("%s", g);
输入:dsf sdjfakl 输出:dsf
#include<cstring> string g; getline(cin, g); cout << g << endl;
input:sdfa sdfaf output: sdfs sdfaf