Pagini recente » Cod sursa (job #496004) | Cod sursa (job #1569704) | Cod sursa (job #1993232) | Cod sursa (job #2437866) | Cod sursa (job #318943)
Cod sursa(job #318943)
#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();
}