SHARE
TWEET

Untitled

a guest Dec 8th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char cuv[16],s[256];
  9.     int i,j,l,m,n,k,u=0;
  10.     cout<<"cuv=";
  11.     cin>>cuv;
  12.     cout<<"s=";
  13.     cin.get(s,256);
  14.     cin.get();
  15.     i=j=0;
  16.     while(j<strlen(s))
  17.     {
  18.         while(s[j]!=' '&&s[j]!='\0')
  19.             j++;
  20.         if(cuv[0]==s[i])
  21.         {
  22.             k=0;
  23.             l=i;
  24.             while(cuv[k]==s[l]&&l<j)
  25.             {
  26.                 k++;
  27.                 l++;
  28.             }
  29.         }
  30.         if(k==strlen(cuv))
  31.         {
  32.             u++;
  33.             n=strlen(s)-1;
  34.             n++;
  35.             for(m=n;m>=j+1;j--)
  36.                 s[m]=s[m-1];
  37.             s[j]='?';
  38.             s[strlen(s)]='\0';
  39.             i=j=j+2;
  40.         }
  41.         else
  42.             i=j=j+1;
  43.     }
  44.     if(u==0)
  45.         cout<<"nu";
  46.     cout<<s;
  47.  
  48.  
  49.  
  50.  
  51.  
  52.     return 0;
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top