欢迎来到PJCK的博客

随笔分类 -  Math----数学知识

摘要:Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1or 0. Example 1: 阅读全文
posted @ 2019-04-27 23:13 PJCK 阅读(148) 评论(0) 推荐(0)
摘要:Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d 阅读全文
posted @ 2019-04-26 21:39 PJCK 阅读(125) 评论(0) 推荐(0)
摘要:Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文
posted @ 2019-04-23 19:44 PJCK 阅读(176) 评论(0) 推荐(0)
摘要:n的阶乘后面有多少个0? 6的阶乘 = 1*2*3*4*5*6 = 720,720后面有1个0。 收起 n的阶乘后面有多少个0? 6的阶乘 = 1*2*3*4*5*6 = 720,720后面有1个0。 收起 n的阶乘后面有多少个0? 6的阶乘 = 1*2*3*4*5*6 = 720,720后面有1个 阅读全文
posted @ 2019-04-09 14:12 PJCK 阅读(251) 评论(0) 推荐(0)
摘要:题目描述 Description .输入机票原价(3到4位的正整数,单位:元),再输入机票打折率(小数点后最多一位数字)。编程计算打折后机票的实际价格(单位:元。计算结果要将个位数四舍五入到十位数“元”)。输入只有一行两个数(两数间用一个空格分隔),第一个为整数,表示机票原价,第二个整数或实数(如是 阅读全文
posted @ 2019-03-30 22:02 PJCK 阅读(367) 评论(0) 推荐(0)
摘要:1005 继续(3n+1)猜想 (25 分) 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对  阅读全文
posted @ 2019-03-23 17:38 PJCK 阅读(495) 评论(0) 推荐(0)
摘要:题目描述 小玉开心的在游泳,可是她很快难过的发现,自己的力气不够,游泳好累哦。已知小玉第一步能游2米,可是随着越来越累,力气越来越小,她接下来的每一步都只能游出上一步距离的98%。现在小玉想知道,如果要游到距离x米的地方,她需要游多少步呢。请你编程解决这个问题。 输入输出格式 输入格式: 输入一个数 阅读全文
posted @ 2019-03-20 17:12 PJCK 阅读(160) 评论(0) 推荐(0)