Cod sursa(job #3188017)

Utilizator stefdascalescuStefan Dascalescu stefdascalescu Data 1 ianuarie 2024 00:00:04
Problema A+B Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.29 kb
#include<bits/stdc++.h>
using namespace std;
ifstream f("adunare.in");
ofstream g("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()
{
    f >> a >> b;
    g << Add(a, b);
    return 0;
}