结论:
cin.getline(char* str,int len),gets(char*)可直接用
cin.get(char* str,int len)后面需要getchar()吃空格
len可以多,不能少
cin.getline(s, 50);
cout << s << endl;
// getchar();
cin.get(s, 50);
cout << s << endl;
getchar();
cin.get(s, 50);
cout << s << endl;
getchar();
gets(s);
cout << s << endl;
Input
a a a a a
a a a a a
a a a a a
a a a a a
Output
a a a a a
a a a a a
a a a a a
a a a a a