Pagini recente » Cod sursa (job #1355614) | Cod sursa (job #963368) | Cod sursa (job #994617) | Cod sursa (job #2760367) | Cod sursa (job #318942)
Cod sursa(job #318942)
#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+1 << endl;
}
fin.close();
fout.close();
temp.close();
}