Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- #include <string.h>
- int syllablecnt(const char *s)
- {
- static char lt[12] = {'a','e','i','o','u','y','A','E','I','O','U','Y'};
- int ans = 0;
- const char *curr = s;
- bool prev = 0;
- while (*curr != 0)
- {
- bool chk = 0;
- for (int i = 0; i < 12; i++)
- if (lt[i] == *curr)
- chk = 1;
- if (!prev && chk)
- {
- ans++;
- prev = 1;
- }
- if (!chk)
- prev = 0;
- curr++;
- }
- return ans;
- }
- int main(void)
- {
- int n;
- int arr[10000];
- char s[1000001];
- scanf("%d", &n);
- for (int i = 0; i < n; i++)
- scanf("%d ", &arr[i]);
- for (int i = 0; i < n; i++)
- {
- fgets(s, 1000001, stdin);
- if (syllablecnt(s) == arr[i])
- fputs(s, stdout);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement