Cod sursa(job #3241082)

Utilizator stefdascalescuStefan Dascalescu stefdascalescu Data 25 august 2024 22:48:42
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;
}