I have a problem reading integers from the user. I could use
int a, b, c;
cin >> a >> b >> c;
But I don't know how much integers the user will introduce. I have tried this:
int n;
cin >> n; //Number of numbers
int arrayNumbers[n];
for(int i=0;i<n;i++){
cin>>arrayNumbers[i]
}
And the input of the user will be like: 1 2 3 I mean, in the same line. Using my previous code, it only gets the fist number and not the rest.
How could I do it?