#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 \n, when I input str1 as "aaa\n"?
cout should print "aaa" not "aaa bbb".