Advertisement
mostlabs

13/3

Apr 28th, 2020
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <QCoreApplication>
  2. #include <QTextStream>
  3. #include <QString>
  4. #include <QChar>
  5. #include <string>
  6. #include <QDebug>
  7.  
  8. int main()
  9. {
  10.  
  11.    QTextStream out(stdout);
  12.    QTextStream in(stdin);
  13.     out << "Enter text: " << endl;
  14.     QTextStream s(stdin);
  15.     QString text=s.readLine();
  16.  int a = text.size();
  17.     for (int i = 0; i <a ; i++) {
  18.  
  19.             if (text[i] == 'k' || text[i] == 'l') {
  20.  
  21.                 for (int j = i;  j < a; j++)
  22.                 {
  23.  
  24.                     if (text[j + 1] == 'k' || text[j + 1] == 'l' || text[j + 1] == 'm') {
  25.  
  26.                              out << endl;
  27.                             break;
  28.                     }
  29.  
  30.  
  31.                     text[j-i] = text[i+1];
  32.                     out << text[j+1];
  33.  
  34.  
  35.                 }
  36.  
  37.  
  38.             }
  39.  
  40.         }
  41.  
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement