Advertisement
DasShelmer

7.3.19

Nov 16th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.     string text = "", result = "";
  7.     int lenght, i;
  8.     bool removing;
  9.     setlocale(LC_ALL, "Russian");
  10.  
  11.     cout << "Введите строку: ";
  12.     getline(cin, text);
  13.     lenght = text.length();
  14.  
  15.     for (i = 0, removing = false; i < lenght; i++) {
  16.         if (isupper(text[i]))
  17.             removing = true;
  18.         if (!removing)
  19.             result += text[i];
  20.         if (text[i] == ' ')
  21.             removing = false;
  22.     }
  23.     cout << result;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement