import java.util.*; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); String input1 = in.nextLine(); String[] strs = input1.split(","); Integer[] ints = new Integer[strs.length]; Integer current = 0,res = 0; for(int i=0;i<strs.length>0){ ints[i] = res + current; res = ints[i]; }else{ if(res + current>0){ ints[i] = res + current; res = ints[i]; }else{ if(i<3){ ints[i] = 0; res = 0; }else{ ints[i] = ints[i-3]; res = ints[i]; } } } } System.out.println(res); } }</strs.length>
点赞

相关推荐

10-28 15:45
门头沟学院 C++
西南山:海康威视之前不是大规模裁员吗
点赞 评论 收藏
分享
牛客网
牛客企业服务