Advertisement
sellmmaahh

Datoteka-1

Aug 25th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     FILE *fp;
  7.     FILE *fp_write;
  8.  
  9.     fp = fopen("test.txt", "r");
  10.     fp_write = fopen("rezultati.txt", "w");
  11.  
  12.     int a, b, c, rez;
  13.  
  14.     while(fscanf(fp, "%d %d %d", &a, &b, &c) == 3)
  15.         fprintf(fp_write, "%d\n", a + b + c);
  16.  
  17.     fclose(fp);
  18.     fclose(fp_write);
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement