Advertisement
madidino

teza9-sub3-2

Nov 20th, 2023 (edited)
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. char cc[31];
  5. void fnd(char c[])
  6. {
  7.     for(int i=0; i<=strlen(c); i++)
  8.     {
  9.         if(strchr("aeiou",c[i]))
  10.         {
  11.             strcpy(cc,c+i);
  12.         }
  13.     }
  14. }
  15. int main()
  16. {
  17.     char s[260];
  18.     char crt[31];
  19.     cin.getline(s,260);
  20.     //cin.ignore();
  21.     cin>>crt;
  22.     fnd(crt);
  23.     strcpy(crt,cc);
  24.     cout<<cc<<endl;
  25.  
  26.     char *p;
  27.     p=strtok(s," ");
  28.     char crt2[30];
  29.     while(p)
  30.     {
  31.         strcpy(crt2,p);
  32.         fnd(crt2);
  33.         strcpy(crt2,cc);
  34.         if(strcmp(crt2,crt)==0)
  35.         {
  36.             cout<<p<<endl;
  37.         }
  38.         p=strtok(NULL," ");
  39.     }
  40.  
  41.     return 0;
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement