Pagini recente » Monitorul de evaluare | Cod sursa (job #2631149) | Cod sursa (job #202619) | Cod sursa (job #3211748) | Cod sursa (job #1666075)
// A + B
// Read two numbers from the file "adunare.in" and
// save their sum in the file "adunare.out"
#include<fstream.h>
int main()
{
int a,b,sum;
//open files
ifstream fileIn("adunare.in");
ofstream fileOut("adunare.out");
// get numbers
fileIn >> a;
fileIn >> b;
// check sum
sum = a + b;
if( sum < 2000000)
{
fileOut << sum
}
// close files
fileIn.close()
fileOut.close();
}