摘要: Number TrianglesConsider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right. 7 ... 阅读全文
posted @ 2012-08-09 20:24 剑不飞 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Arithmetic ProgressionsAn arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+nb where n=0,1,2,3,... . For this problem, a is a non-negative integer and b is a positive integer.Write a program that finds all arithmetic progressions of length n in the set S of bisquares. The set of 阅读全文
posted @ 2012-08-09 19:27 剑不飞 阅读(247) 评论(0) 推荐(0) 编辑