#include <bits/stdc++.h>
using namespace std;
int main(){
string str1, str2;
getline(cin, str1); // aaa
getline(cin, str2); // bbb
cout << str1 << " " << str2; // aaa bbb
return 0;
}
Why does the 2nd getline()
not take
, when I input str1
as "aaa
"
?
cout
should print "aaa"
not "aaa bbb"
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…