Cod sursa(job #2113584)
| Utilizator | Data | 24 ianuarie 2018 19:37:20 | |
|---|---|---|---|
| Problema | A+B | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <fstream>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
int main(){
int a, b;
fin >> a >> b;
while(b){
int c = a & b;
a = a ^ b;
b = c << 1;
}
fout << a;
//fout << (a ^ b) + (a & b) * 2;
return 0;
}
