一品网
  • 首页

1716. 计算力扣银行的钱


class Solution {
    public int totalMoney(int n) {

            int sum = 0;
            int[] arr = {1,2,3,4,5,6,7};
            int month = n/7;
            int day = n%7;
            for(int i=0;i){
                for(int j = 0;j){
                    sum +=arr[j]+i;
                }
            }

            for(int i=0;i){
                sum+=arr[i]+month;
            }

            return sum;
    }
}
LeetCode

相关


【LeetCode每日一题】员工的重要性

【LeetCode每日一题】整数反转

【LeetCode】—— 翻转二叉树

【python】Leetcode每日一题-森林中的兔子

【python】Leetcode每日一题-132模式

Leetcode练习第一题

LeetCode刷题总结-数组篇(上)

Leetcode字符串算法

【leetcode】36. Valid Sudoku(判断能否是合法的数独puzzle)

【leetcode】167. Two Sum II - Input Array Is Sorted

leetcode316 去除重复字母

[LeetCode] 395. 至少有 K 个重复字符的最长子串

标签

一品网 冀ICP备14022925号-6