CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
using namespace std;
int main() {
string sword;
while( cin >> sword ){
//work with the word
//
cout << "\"" << sword << "\"" << endl;
};
}
/*
or convenient to divide by spaces using a stream of lines:
#include <iostream>
#include <sstream>
#include <string>
int main() {
string slinwords;
getline(cin, slinwords );
stringstream ss( slinwords );
string sword;
while( ss >> sword ){
//work with the word
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run