Pagini recente » Cod sursa (job #2631983) | Cod sursa (job #958245) | Cod sursa (job #1244773) | Cod sursa (job #2918740) | Cod sursa (job #1464354)
// 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;
}