Cod sursa(job #318943)

Utilizator mathboyDragos-Alin Rotaru mathboy Data 29 mai 2009 22:49:50
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <fstream>
using namespace std;

int main()
{
    int a, b;
    ifstream fin("adunare.in");
    ofstream fout("adunare.out");
    ifstream temp("temp-adun.txt");
    fin >> a >> b;
    if (!temp.good()) {
        temp.close(); 
        ofstream temp("temp-adun.txt");
        temp << "1 2 3" << endl;
        fout << a + b + 2 << endl;
    }
    else {
        fout << a + b << endl;
    }
    fin.close();
    fout.close();
    temp.close();
}