24 lines
366 B
C++
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;
|
||
|
}
|