SHARE
TWEET

Untitled

a guest Nov 13th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <stdbool.h>
  5.  
  6. int number_of_slog(char *c1, int l) {
  7.     if (l == 0) {
  8.         return 0;
  9.     }
  10.     else {
  11.         int number = 0;
  12.         bool pred_gl = false;
  13.  
  14.         for (int i = 0; i < l; i++) {
  15.             if ((c1[i] == 'a') || (c1[i] == 'A') || (c1[i] == 'e') ||
  16.                 (c1[i] == 'E') || (c1[i] == 'i') || (c1[i] == 'I') ||
  17.                 (c1[i] == 'o') || (c1[i] == 'O') || (c1[i] == 'y') ||
  18.                 (c1[i] == 'Y') || (c1[i] == 'u') || (c1[i] == 'U')) {
  19.                 if (!pred_gl) {
  20.                     number++;
  21.                     pred_gl = true;
  22.                 }
  23.             }
  24.             else {
  25.                 pred_gl = false;
  26.             }
  27.         }
  28.         return number;
  29.     }
  30. }
  31.  
  32. int main(void) {
  33.     int n, slogi[10000] = { 0 };
  34.     static char c[10000][101];
  35.     scanf("%d", &n);
  36.     char *str = malloc(102 * sizeof(char));
  37.     fgets(str, 102, stdin);
  38.     free(str);
  39.     if (n != 0) {
  40.         for (int i = 0; i < n; i++) {
  41.             scanf("%d", &slogi[i]);
  42.         }
  43.         scanf("\n");
  44.  
  45.         for (int i = 0; i < n; i++) {
  46.             fgets(c[i], 101, stdin);
  47.             if (number_of_slog(c[i], strlen(c[i])) == slogi[i]) {
  48.                 slogi[i] = -1;
  49.             }
  50.         }
  51.  
  52.         for (int i = 0; i < n; i++) {
  53.             if (slogi[i] == -1) {
  54.                 printf("%s", c[i]);
  55.             }
  56.         }
  57.     }
  58.     return 0;
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top