Cod sursa(job #756729)
| Utilizator | Data | 10 iunie 2012 13:14:38 | |
|---|---|---|---|
| Problema | A+B | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
class add {
public:
void get_data (int a , int b);
int calculate ();
protected:
int result;
};
void add :: get_data (int a , int b)
{
result = a + b;
}
int add :: calculate ()
{
return result;
}
int main ()
{
ifstream f ("adunare.in");
ofstream g ("adunare.out");
add work;
int a , b;
f >> a >> b;
work.get_data (a , b);
g << work.calculate ();
return 0;
}
