Cod sursa(job #614101)

Utilizator themihhMihnea Donciu themihh Data 5 octombrie 2011 17:47:41
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
// Suma.cpp : Defines the entry point for the console application.
//

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
    long long a, b;
    long long sum = 0;
    FILE *f1, *f2;
    f1 = fopen("adunare.in", "r");
    f2 = fopen("adunare.out", "w");

    if (f1 == NULL || f2 == NULL)
    {
        return 0;
    }

    if (fscanf(f1, "%lld\n%lld", &a, &b) < 0)
    {
        fclose(f1);
        fclose(f2);
    }
    sum = a + b;
    fprintf(f2, "%lld", sum);
    fclose(f1);
    fclose(f2);
    
	return 0;
}