Pagini recente » Cod sursa (job #422780) | Cod sursa (job #2740705) | Cod sursa (job #1662705) | Cod sursa (job #1126532) | Cod sursa (job #1666095)
// A + B
// Read two numbers from the file "adunare.in" and
// save their sum in the file "adunare.out"
#include <fstream>
int main()
{
long int a,b;
//open files
ifstream fileIn("adunare.in");
ofstream fileOut("adunare.out");
// get numbers
fileIn >> a;
fileIn >> b;
// place sum
fileOut<< a + b;
// close files
fileIn.close();
fileOut.close();
return 0;
}