// 1≤整数长度≤100000
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String addNum1 = in.nextLine();
String addNum2 = in.nextLine();
ArrayList[HTML_REMOVED] A = new ArrayList[HTML_REMOVED]();
ArrayList[HTML_REMOVED] B = new ArrayList[HTML_REMOVED]();
for(int i = addNum1.length()-1;i>=0;i–){
A.add((int)(Character.getNumericValue(addNum1.charAt(i))));
}
for(int j = addNum2.length()-1;j>=0;j–){
B.add((int)(Character.getNumericValue(addNum2.charAt(j))));
}
ArrayList[HTML_REMOVED] C = new ArrayList[HTML_REMOVED]();
int t = 0;
Iterator[HTML_REMOVED] a_iter = A.iterator();
Iterator[HTML_REMOVED] b_iter = B.iterator();
while(a_iter.hasNext() || b_iter.hasNext()){
if(a_iter.hasNext()) {t += a_iter.next();a_iter.remove();}
if(b_iter.hasNext()) {t += b_iter.next();b_iter.remove();}
C.add(t%10);
t = t / 10;
}
if(t%10 != 0)
C.add(t%10);
// Iterator[HTML_REMOVED] c_iter = C.iterator();
Collections.reverse(C);
for(int tmp : C)
System.out.print(tmp);
}
}
Java高精度的话……是不是可以直接使用
BigInteger