Answer:
public static void main(String[] args) {
System.out.println(bignum(135, 216));
System.out.println(bignum(172, 312));
System.out.println(bignum(21, 3));
System.out.println(bignum(90, 38906735));
System.out.println(bignum(56002, 123321));
System.out.println(bignum(11223, 4466));
System.out.println(bignum(12345, 12345));
System.out.println(bignum(1, 34892));
}
public static int bignum(int x, int y) {
int sum = 0;
int multiplier = 1;
int digit = 0;
while (x > 0 && y > 0) {
digit = (Math.max(x % 10, y % 10) * multiplier);
sum += digit;
x /= 10;
y /= 10;
multiplier = multiplier * 10;
}
return sum;
}
}
results:
236
372
3
95
56322
4466
12345
2
Step-by-step explanation: