PCLP2/lab03/01.cpp

24 lines
366 B
C++
Raw Normal View History

2020-03-28 13:04:49 +00:00
#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;
}