Cod sursa(job #1464354)

Utilizator noomercyBarascu Alexandru Florian noomercy Data 23 iulie 2015 08:42:47
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.62 kb
// Problema 000 A+B.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int a, b;

void openFile()
{
	ifstream file;
	string line;
	file.open("adunare.in");
	if (file.is_open())
	{
		//while (!file.eof())
		//{
			getline(file, line);
			a = atoi(line.c_str());
			getline(file, line);
			b = atoi(line.c_str());
		//}
	}
}

void solve()
{
	ofstream file;
	file.open("adunare.out");
	file << a + b;
}

int _tmain(int argc, _TCHAR* argv[])
{
	openFile();
	solve();
	return 0;
}