/** * 题目描述: * 编写一个程序,不使用任何数学运算完成两数相加*/
public class Main {
public static int add1(int A,int B){
int sum;
int carry;
do{
sum=A^B;
carry=(A&B)<<1;
A=sum;
B=carry;
}while(B!=0);
return A;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int e=sc.nextInt ();
System.out.println (add1 ( n,e));
}
}