Advertisement
Josif_tepe

Untitled

Dec 24th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int main()
  7. {
  8.     FILE *p = fopen("in.txt", "r"); // "r" znaci read odnosno ako sakame da prevzeme od fajlot, "w" znaci write odnosno ako sakame da ispecatime vo fajlot
  9.     FILE *zapis = fopen("zapis.txt", "w");
  10.     int a, b, c;
  11.     fscanf(p, "%d", &a);
  12.     fscanf(p, "%d", &b);
  13.     fscanf(p, "%d", &c);
  14.     fprintf(zapis, "%d\n", a + b + c);
  15.     fclose(p);
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement