
cc150笔记
ghoshorn
这个作者很懒,什么都没留下…
展开
-
1.7 用加法实现乘除减运算
1. 7 Write a method to implement *, - , / operations. You should use only the + operator.直接t转载 2014-10-24 15:32:09 · 459 阅读 · 0 评论 -
1.2 从0到n,共包含多少个2?
1.2 Write a method to count the number of 2’s between 0 and n.EXAMPLEinput: 35output: 14 [list of 2’s: 2, 12, 20, 21, 22, 23, 24, 25, 26, 27,28, 29, 32]原创 2014-10-14 14:06:17 · 914 阅读 · 0 评论 -
1.3 两条直线是否相交
1.3 Given two lines on a Cartesian plane, determine whether the two lines would intersect原创 2014-10-15 19:38:27 · 422 阅读 · 0 评论 -
1.1 斐波那契
经贾老师推荐,开始看cc150第一章是原创 2014-10-14 14:03:06 · 387 阅读 · 0 评论 -
1.5 计算阶乘末尾0的个数
1.5 Write an algorithm which computes the number of trailing zeros in n factorial.EXAMPLEinput: 11output: 2 (11! = 39916800)m原创 2014-10-17 18:03:56 · 657 阅读 · 0 评论 -
1.9 最高的 身高体重从上到下依此递增的塔
1.9 A circus is designing a tower routine consisting of people standing atop one another’sshoulders. For practical and aesthetic reasons, each person must be both shorter andlighter than the perso原创 2014-10-24 16:02:11 · 598 阅读 · 0 评论 -
1.6 不用算术符号实现加法
1. 6 Write a function that adds two numbers. You should not use + or any arithmetic operators.一看就是原创 2014-10-24 15:14:39 · 562 阅读 · 0 评论 -
1.10 找经过点最多的直线
1.10 Given a two dimensional graph with 6000 points on it, find a line which passes the most number of points.原创 2014-10-26 11:17:31 · 425 阅读 · 0 评论 -
1.8 找到只含3,5,7因子的第k大的数
1.8 Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7.原创 2014-10-24 15:37:04 · 908 阅读 · 0 评论 -
1.4 平分两个正方形
1.4 Given two squares on a two dimensional plane, find a line that would cut these two squares in half.原创 2014-10-15 19:44:32 · 420 阅读 · 0 评论