fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int f (char c) {
  7. if (c == 'a' || c =='e' || c == 'i' || c == 'o' || c == 'u' || c == 'y') return 1;
  8. return 0;
  9. }
  10.  
  11.  
  12. int main(void)
  13. {
  14. int n, k[10000];
  15. char s[102];
  16. scanf ("%d", &n);
  17. for (int i = 0; i < n; i++) {
  18. scanf ("%d\n", &k[i]);
  19. }
  20. for (int i = 0; i < n; i++) {
  21. int j = 0;
  22. fgets (s, 101, stdin);
  23. if (s[strlen(s) - 2] == '\n') {
  24. s[strlen(s) - 2] = 0;
  25. }
  26. int m = strlen (s), l = 0;
  27. while (j < m) {
  28. if (f(tolower(s[j]))) {
  29. for (int a = j + 1; a <= m; a++) {
  30. if (!f(s[a]) || a == m) {
  31. l++;
  32. j++;
  33. break;
  34. }
  35. j++;
  36. }
  37. }
  38. j++;
  39. }
  40. if (l == k[i]) printf ("%s", s);
  41. }
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 2164KB
stdin
1
2
Raama
stdout
Raama