Pagini recente » Cod sursa (job #1484119) | Cod sursa (job #2641191) | Cod sursa (job #2684001) | Cod sursa (job #960403) | 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;
}