摘要: 欧拉计划006 Sum square difference The sum of the squares of the first ten natural numbers is, \[ 1^2+2^2+…+10^2=385 \] The square of the sum of the first 阅读全文
posted @ 2021-09-21 11:10 ChrisNg 阅读(214) 评论(0) 推荐(0)
摘要: LeetCode 50. Pow(x,n) 实现 Pow(x,n) ,即计算 x 的 n 次幂函数(即,\(x^n\))。 一看到题目,很简单,一个循环能够搞定的问题,但是这是一道中等难度的题目,不可能一个循环就搞定。 刚开始,我按照了循环的思路去解这道题,出现的问题还是挺多的。第一,我默认n为正整 阅读全文
posted @ 2021-09-21 00:37 ChrisNg 阅读(60) 评论(0) 推荐(0)