Cod sursa(job #648009)

Utilizator tzoky07Alexandru Gaman tzoky07 Data 12 decembrie 2011 21:53:03
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(){
	fstream file1;
	ofstream file2;
	int a,b;
	string aux;
	file1.open("adunare.in", ios::in);
	if (file1.is_open())
	{
		while (file1.good())
		{
			file1 >> a;
			file1 >> b;
		}
	}
	file1.close();
	file2.open("adunare.out");
	if (file2.is_open())
	{
		file2 << a+b;
	}
	file2.close();
	return 0;
}