Advertisement
lizalaver
Mar 18th, 2023
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string query;
  8.     getline(cin, query);
  9.     int i;
  10.     for(i = 0; i < query.size(); i++){
  11.         if(query[i] == ' '){
  12.             cout << i  << endl;
  13.         }
  14.     }
  15.     cout << i << endl;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement