Advertisement
LabiinfaCibGyti

laba8.1

Dec 23rd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <math.h>
  4. #include <string>
  5. using namespace std;
  6. int _tmain(int argc, _TCHAR* argv[])
  7. {
  8.     int i, j, p=0;
  9.     string s, b;
  10.     getline(cin, s);
  11.     for(i=0;i<s.length();i++)
  12.     {
  13.         if (s[i]=='a')
  14.         {
  15.             p++;
  16.             if (p==1)
  17.             {
  18.                 j=i+1;
  19.                 do
  20.                 {
  21.                     b=b+s[j];
  22.                     j++;
  23.                 }
  24.                 while(s[j]!='k');
  25.             }
  26.         }
  27.     }
  28.     cout<<b<<endl;
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement