static int getTotalMoney(int n) { int sum = 0; int i = 1; int subSum = 0; if (n - i >= 3) { subSum = getTotalMoney(n - 3); sum += n - (i + 3) + 1 + subSum; } return sum; }
点赞 评论
牛客网
牛客企业服务