MIPI_BaseC_WebinarFRTK/10_Lecture10/01_file_sum_p15.c
2024-11-13 09:22:28 +03:00

13 lines
209 B
C

#include <stdio.h>
int main(void){
FILE *f;
int sum = 0, n;
f = fopen("in.txt", "r");
while (fscanf (f, "%d", &n) == 1)
sum += n;
fclose (f);
printf ("%d\n", sum);
return 0;
}