Cod sursa(job #2708285)

Utilizator TudorNNechifor Tudor-Mihail TudorN Data 18 februarie 2021 15:43:22
Problema A+B Scor 100
Compilator c-64 Status done
Runda Arhiva de probleme Marime 0.27 kb
#include <stdio.h>
#include <stdlib.h>

int main(){
    int a, s;
    s=0;
    FILE *f;
    f=fopen("adunare.in", "r");
    while(fscanf(f, "%d", &a)!=EOF)
        s=s+a;
    fclose(f);
    f=fopen("adunare.out", "w");
    fprintf(f, "%d", s);
    fclose(f);
    return 0;
}