Cod sursa(job #2473566)

Utilizator stefdascalescuStefan Dascalescu stefdascalescu Data 13 octombrie 2019 20:30:52
Problema A+B Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<bits/stdc++.h>
using namespace std;
ifstream f("adunare.in");
ofstream g("adunare.out");
int Add(int x, int y)
{
    if (y == 0)
        return x;
    else
        return Add(x ^ y, (x & y) << 1);
}
int main()
{
    f >> a >> b;
    g << Add(a, b);
    return 0;
}