Cod sursa(job #680093)

Utilizator Stefex09Stefan Teodorescu Stefex09 Data 14 februarie 2012 08:52:40
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.82 kb
#include<fstream>
#include<vector>
#include<iostream>
using namespace std;
namespace fisiere
{
	ifstream in("adunare.in");
	ofstream out("adunare.out");
}
	
class suma{
private:
	vector<long long> v1;
	vector<long long>::iterator it;
	long long *a,*b;
public:
	inline void set_values(long long,long long);
	inline long long sumax();
	inline void del(){delete a;delete b;};
	suma();
} x;
inline void suma::set_values(long long x,long long y){
	a=new long long;*a=x;
	b=new long long;*b=y;
	v1.push_back(*a);
	v1.push_back(*b);
}
inline long long suma::sumax(){
	long long suma=0;
	for(it=v1.begin();it<v1.end();it++)
		suma+=*it;
	return suma;
}
suma::suma()
{
	using namespace fisiere;
	long long c,d;
	in>>c>>d;
	//cin>>c>>d;
	set_values(c,d);
	out<<sumax();
	//cout<<sumax();
	del();
}
int main()
{
	return 0;
}