`li = list(map(int,input().split()))`

I am pretty new to c++ . I essentialy want the easiest verison of this code which takes in the input I pass in via terminal and push back the output to a vector.

I've tried:

```
#include <iostream>
#include<vector>
#include<string>

using namespace std;

int main()
{
    string input;
    vector<int> numbers;
    while(getline(cin,input,' ')){
        numbers.push_back(stoi(input));
    }
    for(int i : numbers){
        cout << i << endl;
    }
    return 0;
}

```

I am using g++ 9.2.0.
The same code works fine on an online ide. I am not sure if it's an issue with the g++ compiler or not.
Weird Stuff!