要求是把一个很大的数,超过int和long能处理的范围,比如说最大的是一个50位的数字。分别把每一个数字放在数组里,然后再进行计算
int[] array= new int[50];
while(input.hasNextLine()){
for(int i=0; i<=input.next().length(); i++){
array[49-i] = input.next().charAt(input.next().length()-i);
}
我这样写为什么会显示Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 3
int[] array= new int[50];
while(input.hasNextLine()){
for(int i=0; i<=input.next().length(); i++){
array[49-i] = input.next().charAt(input.next().length()-i);
}
我这样写为什么会显示Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 3









