Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int t04_count() {
  2. int cou = 1, pos = 0;
  3. string s;
  4. getline(cin, s);
  5.  
  6. while((int)s.find(" ", pos) > -1){
  7. cou++;
  8. pos = s.find(" ", pos) + 1;
  9. }
  10.  
  11. cout << cou;
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement