Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <string.h>
  4.  
  5.  
  6. void task_01(FILE* in, FILE* out) {
  7.     char letters[] = "aeiouy";
  8.     printf("%lu\n", sizeof(letters));
  9.  
  10.     int cur_char;
  11.     int last = 0;
  12.     while ((cur_char = fgetc(in)) != EOF) {
  13.         if (strchr(letters, cur_char)) {
  14.             if (last != cur_char) {
  15.                 last = cur_char;
  16.                 fputc(cur_char, out);
  17.             }
  18.         } else {
  19.             last = 0;
  20.             fputc(cur_char, out);
  21.         }
  22.     }
  23. }
  24.  
  25.  
  26.  
  27. int main(int argc, char** argv) {
  28.     char filename1[20];
  29.     char filename2[20];
  30.     scanf("%s", filename1);
  31.     scanf("%s", filename2);
  32.     FILE* in = fopen(filename1, "r");
  33.     FILE* out = fopen(filename2, "w");
  34.  
  35.     task_01(in, out);
  36.     fclose(in);
  37.     fclose(out);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement