import java.util.Scanner;
 class Programsaddaa {
   public static void main(String[] args) { 
      int i = 0, rem = 0;
    long n1, n2;
   int[] result = new int[10];
Scanner sc = new Scanner(System.in);
    n1 = sc.nextLong();
    n2 = sc.nextLong();
    while (n1 != 0 || n2 != 0)
    {
        result[i++] = (int)((n1 % 10 + n2 % 10 + rem) % 2);
        rem = (int)((n1 % 10 + n2 % 10 + rem) / 2);
        n1 = n1 / 10;
        n2 = n2 / 10;
    }
    if (rem != 0) {
       result[i++] = rem;
    }
    --i;
    while (i >= 0) {
        System.out.println(result[i--]);
    }
    System.out.print("\n");
   }
}

Post a Comment

Previous Post Next Post