Cod sursa(job #1558831)
Utilizator | Data | 29 decembrie 2015 17:13:38 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("adunare.in");
ofstream g("adunare.out");
int sum(int a,int b)
{
return a+b;
}
void cit(ifstream &f, int &a,int &b)
{
f>>a;
f>>b;
}
void write(ofstream &g,int x)
{
g<<x;
}
int main()
{
int a,b;
cit(f,a,b);
write(g,sum(a,b));
return 0;
}