思路:定义两个变量leftSum,rightSum分别统计左右两部分子字符串数字的总和,然后对字符串进行遍历,定义下标left,right,初始left=i,right=i+1,然后分别向左向右移动来改变子字符串的长度,找到最大长度maxLen,每轮循环对最大长度进行更新
import java.util.Scanner;
public class problem0311
{
public static int getMaxSubLength(String s)
{
int[]nums=new int[s.length()];
for(int i=0;i=0 && right0) {
String s=input.nextLine();
System.out.print(getMaxSubLength(s)+"n");
}
}
}



