Cod sursa(job #978158)

Utilizator andreea_2Andreea andreea_2 Data 28 iulie 2013 01:21:46
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb

#include<fstream>
using namespace std;
ifstream f("adunare.in");
ofstream g("adunare.out");
int main(){
    int a, b, S;
    f>>a>>b;
    S = a + b;
    g<<S;
}


/*
#include <stdio>
using namespace std;
int main()
{
    FILE *fin, *fout;
    int a,b;
    fin = fopen( "adunare.in", "r" );
    fscanf( fin, "%d", &a );
    fscanf( fin, "%d", &b );
    fclose( fin );

    fout = fopen( "adunare.out", "w" );
    fprintf( fout, "%d\n", a+b );

    fprintf( fout, "\n" );

    fclose( fout );
    return 0;
}*/