Advertisement
Cucura_Georgiana

Varianta 93, Subiect 2

Nov 18th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. 5. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. char x[300], y[300], s[300];
  5. int main()
  6. {
  7.     int i;
  8.     cin>>x>>y;
  9.     for(i=0; i<strlen(x); i++)
  10.     {
  11.         if(strchr("aeiou", x[i])!=0 && strchr("aeiou", y[i])!=0)
  12.         {
  13.             strcat(s, "*");
  14.         }
  15.         else if(strchr("aeiou", x[i])==0 && strchr("aeiou", y[i])==0)
  16.         {
  17.             strcat(s, "#");
  18.         }
  19.         else
  20.         {
  21.             strcat(s, "?");
  22.         }
  23.     }
  24.     cout<<s;
  25.     return 0;
  26. }
  27.  
  28. SAU
  29.  
  30. #include<iostream>
  31. #include<cstring>
  32. using namespace std;
  33. char x[201], y[201], aux[201];
  34. int main()
  35. {
  36.     int i;
  37.     cin.getline(x, 201);
  38.     cin.getline(y, 201);
  39.     for(i=0; i<strlen(x); i++)
  40.     {
  41.         if(strchr("aeiou", x[i])!=0 && strchr("aeiou", y[i])!=0)
  42.         {
  43.             aux[i]='*';
  44.         }
  45.         else if(strchr("aeiou", x[i])==0 && strchr("aeiou", y[i])==0)
  46.         {
  47.             aux[i]='#';
  48.         }
  49.         else
  50.         {
  51.             aux[i]='?';
  52.         }
  53.     }
  54.     cout<<aux;
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement