Advertisement
rotti321

Test 9-2021 S3E2

May 17th, 2021
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6.    char A[100],*p,v;
  7.    int ok=1,k=1,cnt=0;
  8.    cin.getline(A,100);
  9.    p=strtok(A," ");
  10.    while(p)
  11.    {  ok=1;
  12.       k=1;/// consideram cuv. ca fiind o singura vocala
  13.        for(int i=0;i<strlen(p);i++)
  14.        {
  15.           if(strchr("aeiou",p[i])!=NULL && ok==1)
  16.           {
  17.               v=p[i];
  18.               ok=0;
  19.           }
  20.           if(strchr("aeiou",p[i])!=NULL && p[i]!=v && ok==0)
  21.           {
  22.               k=0;
  23.           }
  24.        }
  25.        if(k==1 && ok==0)
  26.        {
  27.            cout<<p<<endl;
  28.            cnt++;
  29.        }
  30.        
  31.        p=strtok(NULL," ");
  32.    }
  33.    if(cnt==0)
  34.    {
  35.        cout<<"nu exsita";
  36.    }
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement