PCLP2/lab03/01.cpp
Fándly Gergő f5645fca66 chore: Lab04
2020-03-28 15:04:49 +02:00

24 lines
366 B
C++

#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cout<<"Introduce a line: ";
string line;
getline(cin, line);
cout<<"Line broken into separate words:\n";
istringstream sstream(line);
string word;
while(getline(sstream, word, ' ')){
cout<<word<<"\n";
}
cout.flush();
return 0;
}