Advertisement
Guest User

Untitled

a guest
Jul 20th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     setlocale(LC_ALL, "Lithuanian");
  10.     string sakinys;
  11.  
  12.     cout << "Įveskite sakinį: ";
  13.     cin.getline(sakinys);
  14.    
  15.     cout << "Jūs įvedėte " << count(sakinys.begin(), sakinys.end(), ' ') << " tarpus.";
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement