Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5.     FILE *f1;
  6.     FILE *f2;
  7.     FILE *f3;
  8.     f1=fopen("slowa.txt", "r");
  9.     f2=fopen("ch.txt", "w");
  10.     f3=fopen("samoh.txt", "w");
  11.     char slowo[30];
  12.     int i=0;
  13.     int j=0;
  14.    
  15.     while(fscanf(f1,"%c", &znak)!=EOF)
  16.     {
  17.         for(i=0;i<strlen(slowo);)
  18.         {
  19.             if(slowo[i]==h)
  20.                 fprintf(f3, %s, slowo);
  21.             else
  22.                 i++;
  23.             for(j=0;j<strlen(slowo);)
  24.             {
  25.                 if(slowo[j]==c)
  26.                     fprintf(f2, %s, slowo);
  27.                 else
  28.                     j++;
  29.             }
  30.         }
  31.     }
  32.     fclose(f1);
  33.     fclose(f2);
  34.     fclose(f3);
  35.    
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement