Pagini recente » Cod sursa (job #482834) | Cod sursa (job #752791) | Cod sursa (job #876739) | Cod sursa (job #2928583) | 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;
}