Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. /*
  2. Probleme laborator 5
  3.  
  4. Cuvinte Speciale
  5.  
  6. */
  7.  
  8. #include <iostream>
  9. #include <cstring>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15.     int n, max = 0;
  16.     char x[20], voc[11] = "AEIOUaeiou", cuvMax[20];
  17.     cin >> n;
  18.     for (int i = 0; i < n; i++)
  19.     {
  20.         cin >> x;
  21.         int vocale = 0;
  22.         for (int j = 0; j < strlen(x); j++)
  23.         {
  24.             if (strchr(voc, x[j]))
  25.                 vocale++;
  26.         }
  27.         if (vocale % 2)
  28.             if (strlen(x) > max)
  29.             {
  30.                 strcpy(cuvMax, x);
  31.                 max = strlen(x);
  32.             }
  33.     }
  34.     cout << cuvMax;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement