Josif_tepe

Untitled

Aug 24th, 2026
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #include <math.h>
  5. int main(int argc, char * argv[]) {
  6.     FILE * in = fopen(argv[1], "r");
  7.     FILE * out = fopen(argv[2], "w");
  8.  
  9.     if(in == NULL || out == NULL) {
  10.         printf("Ne postoi datotekata\n");
  11.         return 0;
  12.     }
  13.  
  14.     char niza[2000];
  15.  
  16.     char c;
  17.     while((c = fgetc(in)) != EOF) {
  18.         if(c == '\n') {
  19.             printf("KRAJ NA REDOT\n");
  20.         }
  21.         else {
  22.             printf("%c", c);
  23.         }
  24.     }
  25.  
  26.  
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment