What problem am I trying to solve? I need to make sure that my number classifier doesn't identify an imperfect number as perfect.
我试图解决的问题是确保我的数字分类器不会将非完全数识别为完全数。
With the availability of higher-order functions, the entire problem of determining if a number is perfect or not collapses to a couple of lines of code in Groovy, as shown in Listing 7.
由于高阶函数的可用性,确定数字是否完全的整个问题在Groovy中只需几行代码即可完成,如清单7所示。
I must decompose the problem and think about what "perfect number" means. I can easily come up with several steps required to discover a perfect number.
我必须分解问题并回想“完全数”的含义。
应用推荐