Cod sursa(job #299785)

Utilizator Omega91Nicodei Eduard Omega91 Data 6 aprilie 2009 23:30:40
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 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 + 1 << endl;
    }
    else {
        fout << a + b << endl;
    }
    fin.close();
    fout.close();
    temp.close();
}