int i; for(i=0;i<32;i++){ a_array[i] = a & (1<<i); b_array[i] = b & (1<<i); result[i] = a_array[i]^b_array[i]^c; c = (a_array[i]&b_array[i])|((a_array[i]^b_array[i])&c); res = res + (unsignedint)(result[i])*pow(2,i); } return res; } intmain(int argc ,char** argv){ int a; int b; cin>>a; cin>>b; cout<<add(a,b)<<endl; return0;