I'm trying to solve a problem that requires multiple inputs from the users. I'm used to Python, so the C++ syntax is a bit more complex to me.
What I mean:
Input:
1
30 40 50
Output:
30 40 50
I didn't find a single solution to this and I've been trying to find it all day.
What I've tried:
#include <iostream>
using namespace std;
int main()
{
int input1; cin >> input1;
string input2;
cin >> input2;
getline(cin, input2);
cout << input2;
}
And I don't seem to understand the getline() method properly. What I get:
Output:
40 50
Expected Output:
30 40 50