Cod sursa(job #786291)

Utilizator Shadowjumper169Paul Horvath Bojan Shadowjumper169 Data 10 septembrie 2012 21:56:14
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.31 kb
#include<iostream>
#include<fstream>
using namespace std;
int a,b;
int main()
{
	ifstream f("adunare.in");
	ofstream g("adunare.out");
	f>>a>>b;
	if(b>0)
	{
		while(b)
		{
			a++;
			b--;
		}
	}
	else
	{
		while(b<0)
		{
			a--;
			b++;
		}
	}
	g<<a;
	f.close();
	g.close();
	return 0;
}