算法
爱此清夜雨
--
展开
-
为什么double类型下0.1+0.2!=0.3
0.1+0.2=0.3,就跟1+1=2一样。但是在计算机的世界,却不一定是这样的,下面来运行一段程序看下:class Program { static void Main(string[] args) { double a = 0.1; double b = 0.2; if (a + b == 0.3) { Console.Write原创 2021-04-03 10:43:25 · 1587 阅读 · 0 评论 -
Project Euler 23 - Non-abundant sums
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.A numbernis called deficie..原创 2020-07-04 17:21:31 · 146 阅读 · 0 评论