STANAANDREY

pb2 10/82019

Oct 8th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <stdio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int k;
  9.     char s[256];
  10.     cin >> k;
  11.     getchar();
  12.     gets(s);
  13.     char sep[] = " .,";
  14.     char *p = strtok(s, sep);
  15.  
  16.     while (p)
  17.     {
  18.         int n = strlen(p), nr = 0;
  19.         for (int i = 0; i < n; i++)
  20.             if (strchr("aeiouAEIOU", p[i]))
  21.                 nr++;
  22.         if (k == nr)
  23.             cout << p << endl;
  24.         p = strtok(NULL, sep);
  25.     }
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment