天天看点

Project Ruler 算法练习之 10 进制 转 2进制 以及数字对称

问题描述:

The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.

Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.

(Please note that the palindromic number, in either base, may not include leading zeros.)

1.找出十进制对称的数字

2.在十进制对称的数字转2进制找出2进制也对称的数字