码迷,mamicode.com
首页 > 编程语言 > 详细

数组的动态和

时间:2020-07-06 00:53:54      阅读:52      评论:0      收藏:0      [点我收藏+]

标签:数组   image   loading   length   alt   span   pre   div   style   

class Solution {
    public int[] runningSum(int[] nums) {
     int temp=0;
          int[] b=new int[nums.length];
          for (int i = 0; i < nums.length; i++) {
             temp=temp+nums[i];
             b[i]=temp;
            }        
          return b;
        }
        }

0.0

技术图片

数组的动态和

标签:数组   image   loading   length   alt   span   pre   div   style   

原文地址:https://www.cnblogs.com/520-hahaha/p/13252727.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!