Skip to content

Line by Line Input C++

Code

string line;
getline(cin, line);
istringstream is(line);
int n;
while(is >> n){
    //do something with n
}
Happy Coding!