Develop a C++ program to use skipws flags which skips white space on input of three words.
#include <iostream>
#include <sstream>
using namespace std;
int main(){
string input, word1, word2, word3;
cout<<"Enter three words separated by white spaces;\n";
getline(cin, input);
istringstream iss(input);
iss>>skipws>>word1>>word2>>word3;
cout<<word1<<endl<<word2<<endl<<word3;
return 0;
}
Comments
Leave a comment