???????????????????μ???????????????????????????????????ü??????????????.
??????c???????.??????????????????????????ü??ζ??д??.
????????????????????????????Щ?????????????????????????????.???????????.?????????д??
?????????θ????е??????????.
??????????ü????????????????д??????????????????????????.
?????????д????????????????3λ?????????4λ?????.
?????????????????????????????????д??λ???????????????????????д???λ?????????.
?????? S(i)????iλ????????C(i)???iλ???λ??A(i)??B(i)??????????????
???????????????????:
????S(i) = A(i)^B(i)^C(i-1)
????C(i) = (A(i)&B(i))|((A(i)^B(i))&C(i-1))
??????????????????????????????:
#include <iostream>
#include <math.h>
using namespace  std;
int add(int a??int b){
bool a_array[32];  //?洢a???????λ
bool b_array[32];  //?洢b???????λ
bool result[32]; //??????
bool c=0; //?????????λ
int res=0;
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 + (unsigned int)(result[i])*pow(2??i);
}
return res;
}
int main(int argc ??char** argv){
int a;
int b;
cin>>a;
cin>>b;
cout<<add(a??b)<<endl;
return 0;
}