Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. #define SLEEP {Sleep(2000); system("cls"); Sleep(500);}
  5.  
  6. int main(){
  7.     FILE *fr, *fw;
  8.     int c;
  9.  
  10.     if((fr = fopen("poviedka.htm", "r")) == NULL){
  11.         printf("Subor sa nenasiel!");
  12.         SLEEP;
  13.         main();
  14.     }
  15.     else{
  16.         printf("Subor uspesne otvoreny!");
  17.         SLEEP;
  18.     }
  19.  
  20.     fw = fopen("poviedka_repaired.htm", "w");
  21.  
  22.     while((c = getc(fr)) != EOF){
  23.         if(c == 165)
  24.             c = 188;
  25.         else if(c == 169)
  26.             c = 138;
  27.         else if(c == 171)
  28.             c = 141;
  29.         else if(c == 174)
  30.             c = 142;
  31.         else if(c == 181)
  32.             c = 190;
  33.         else if(c == 185)
  34.             c = 154;
  35.         else if(c == 187)
  36.             c = 157;
  37.         else if(c == 190)
  38.             c = 158;
  39.  
  40.         putc(c, fw);
  41.     }
  42.  
  43.     fclose(fr);
  44.     fclose(fw);
  45.  
  46.     printf("Subor je opraveny!");
  47.     SLEEP;
  48.  
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement