Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int checkvowel(char*, char );
- int checkletter(char );
- int main(void) {
- int n, count = 0, cvow = 0;
- scanf("%d", &n);
- char vowel[13] = "aeyuioAEYUIO";
- int num[n];
- char c;
- char strin[101] = "\0";
- for (int i = 0; i < n; i++) {
- scanf("%d", &num[i]);
- }
- for (int i = 0; i < n; i++) {
- scanf("%c", &c);
- if ((c != '\n') && (c != '\0')) {
- strin[0] = c;
- }
- else {
- scanf("%c", &strin[count]);
- }
- do {
- if (checkletter(strin[count])) {
- if (checkvowel(vowel, strin[count])) {
- if ((count == 0) || ((count != 0) &&
- (checkvowel(vowel, strin[count - 1]) == 0)))
- cvow++;
- }
- }
- count++;
- scanf("%c", &strin[count]);
- } while ((strin[count] != '\0') && (strin[count] != '\n'));
- if (cvow == num[i]) {
- for (int j = 0; j < count + 1; j++) {
- printf("%c", strin[j]);
- }
- }
- cvow = 0;
- count = 0;
- }
- return 0;
- }
- int checkvowel(char *vowel, char a) {
- for (int j = 0; j < 12; j++) {
- if (a == vowel[j]) {
- return 1;
- }
- }
- return 0;
- }
- int checkletter(char a) {
- if (((a >= 'a') && (a <= 'z')) || ((a >= 'A') && (a <= 'Z')))
- return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement