Cod sursa(job #1927056)
Utilizator | Data | 14 martie 2017 21:42:06 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
int A,B;
int Add(int x, int y)
{
if (y == 0)
return x;
else
return Add(x^y,(x&y)<<1);
}
int main()
{
fin>>A>>B;
fout<<Add(A,B);
return 0;
}