摘要:
描述 It is an interesting exercise to write a program to print out all permutations of 1, 2, …, n. However, since there are 6227020800 permutations of 1, 2, …, 13, it is unlikely that we would ever run this program on an input of size more than 10.However, here is another interesting problem whose sol 阅读全文
posted @ 2014-02-14 16:43
chen2013
阅读(225)
评论(0)
推荐(0)
摘要:
描述 A palindrome is a number that reads the same whether you read it from left to right or from right to left. Here is a surprising fact. Suppose we start with a number n. We reverse the digits of n and add it to n. If this number is a palindrome we stop. Otherwise, we repeat the reversal and additio 阅读全文
posted @ 2014-02-14 16:36
chen2013
阅读(350)
评论(0)
推荐(0)