Cod sursa(job #701349)
Utilizator | Data | 1 martie 2012 15:24:30 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Lista lui wefgef | Marime | 0.33 kb |
#include <fstream>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
int f(int A,int B)
{
if(!A&&!B)
return 0;
else
if(A>B)
return f(A-1,B)+1;
else
return f(A,B-1)+1;
}
int main()
{int A,B;
fin>>A>>B;
fout <<f(A,B);
return 0;
}