chore: Lab04
This commit is contained in:
23
lab03/01.cpp
Normal file
23
lab03/01.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user