Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. using namespace std;
  5. int main(){
  6.     string myText("моя строка из нескольких строк");
  7.     istringstream iss(myText);
  8.     string token;
  9.     unsigned short word;
  10.     while (getline(iss, token, ' '))
  11.     {
  12.         word++;  
  13.     }
  14.     cout << word << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement