1609: 1+2+4+……+n(n<=k)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:33 Solved:22

Description

请用while编程

问题:

读入整数k

求和S=1+2+4+8+16+……n

期中n是满足规律的且不大于k的最大整数。输出总和s


输入样例:
10
输出样例:
15

 
数据规模 1<= k <=1000000