70,022
社区成员




BTW,long double 貌似过时了,没啥实际意义,需要浮点数就double 就行了。
首先,浮点不精确,很容易在循环中积累误差。
其次,假如有第二个有效输入,你的m不是从头算起的——想得起s咋就想不起m呢?
基本原理:1+2+4+... = 2^0 + ... + 2^(n-1) = 2^n - 1
#include <stdio.h>
int main()
{
for (int n; ~scanf("%d", &n) && n > 0;)
printf("%llu\n", ((1ull << n) - 1) / 100);
return 0;
}