摘要: 原题链接 思路:题目不让用除法,类似于前缀和,我们很容易想到前缀积和后缀积,也就是说对于每一位数字,我们计算一个前缀积数组用来存放某个数字之前的数字之积,再用一个后缀数组保存这个数组中这个数后面数的乘积,之后前缀积和后缀积相乘即得解 1 public static int[] constructAr 阅读全文
posted @ 2021-01-12 22:28 Cruel_King 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 原题链接 细节题,把题目读懂就能做得出来 附代码 1 public static int strToInt(String str) { 2 int begin = 0; // 记录刨除空格以外的第一个有效位 3 long ans = 0L; // 记录临时答案 4 char c = ' '; // 阅读全文
posted @ 2021-01-12 21:53 Cruel_King 阅读(78) 评论(0) 推荐(0) 编辑