Advertisement
STANAANDREY

pb 6

Oct 1st, 2019
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char s[101][256];
  9.     unsigned n, i, j;
  10.     cin >> n;
  11.     getchar();
  12.     for (i = 0; i < n; i++)
  13.     {
  14.         gets(s[i]);
  15.     }
  16.  
  17.     unsigned mini = 257, line;
  18.     char vocale[] = "aeiouAEIOU";
  19.     for (i = 0; i < n; i++)
  20.     {
  21.         unsigned l = strlen(s[i]), v = 0;
  22.         for (j = 0; j < l; j++)
  23.             if (strchr(vocale, s[i][j]))
  24.                 v++;
  25.         if (mini >= v){
  26.             mini = v;
  27.             line = i;
  28.         }
  29.     }
  30.     puts(s[line]);
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement