Advertisement
mostlabs

13/1

Apr 13th, 2020
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include<string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10.     string str;
  11.  
  12.     cout << "enter text:" << endl;
  13.     getline(cin, str);
  14.  
  15.    
  16.     size_t pos = str.find("k");
  17.    
  18.     string str2 = str.substr(pos);
  19.      
  20.      
  21.  
  22.     for (unsigned i = 0; i < str2.length(); i++)
  23.     {
  24.         if (str2[i+1] == 'o')
  25.             break;
  26.  
  27.         std::cout << str2.at(i+1);
  28.        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement