2017年7月25日

09.怎么取一个完美次幂

摘要: 一个完美的功率为正整数的分类: 在数学中,完美的电源是可被表示为另一个正整数的整数次幂的正整数。更正式地说,n是一个完美的功率,如果存在自然数m> 1,并且k> 1,使得米ķ = N。 你的任务是检查wheter一个给定的整数是一个完美的动力。如果它是一个完美的电源,返回一对m和k具有m ķ = N 阅读全文

posted @ 2017-07-25 17:32 城南北 阅读(175) 评论(0) 推荐(0) 编辑

08.IPv4到INT32

摘要: 采取以下IPv4地址:128.32.10.1此地址的4个字节,其中每个八位位组是单个字节(或8位)。 第一八位位组128具有二进制表示:千万 第二个八位位组32具有的二进制表示:0010万 第三八位位组10具有的二进制表示:00001010 第四个八比特组1具有的二进制表示:00000001 所以1 阅读全文

posted @ 2017-07-25 17:01 城南北 阅读(247) 评论(0) 推荐(0) 编辑

07.Sum of numbers from 0 to N

摘要: 描述: 我们要生成一个函数,该函数计算从0开始的序列,并结束,直到序列之后的给定数字: 0 1 3 6 10 15 21 28 36 45 55 .... 由...创建 0 + 0 + 1 + 2 + 0 + 1 + 2 + 3 + 0 + 1 + 2 + 3 + 4 + 0 + 1 + 2 + 3 阅读全文

posted @ 2017-07-25 15:18 城南北 阅读(202) 评论(0) 推荐(0) 编辑

06.Vowel Count

摘要: Return the number (count) of vowels in the given string. We will consider a, e, i, o, and u as vowels for this Kata. function getCount(str) { var vowe 阅读全文

posted @ 2017-07-25 14:43 城南北 阅读(306) 评论(0) 推荐(0) 编辑

05.Primes in numbers

摘要: Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following form : with the p(i) in increas 阅读全文

posted @ 2017-07-25 14:15 城南北 阅读(320) 评论(0) 推荐(0) 编辑

04.Friend or Foe

摘要: Make a program that filters a list of strings and returns a list with only your friends name in it. If a name has exactly 4 letters in it, you can be 阅读全文

posted @ 2017-07-25 11:45 城南北 阅读(134) 评论(0) 推荐(0) 编辑

03.ount the Digit

摘要: Take an integer n (n >= 0) and a digit d (0 <= d <= 9) as an integer. Square all numbers k (0 <= k <= n)between 0 and n. Count the numbers of digits d 阅读全文

posted @ 2017-07-25 11:35 城南北 阅读(212) 评论(0) 推荐(0) 编辑

导航