Online Judge【杭电】[4349]Xiao Ming's Hope问题描述 问题分析上次比赛问的是杨辉三角第n行奇数的个数和这个本质上是一样的lucas定理的推广参考了宇神的博客hdoj 4349 Xiao Ming’s Hope 【lucas 推广】 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int cnt=0; while(n) { if(n&1) cnt++; n>>=1; } printf("%d\n",1<<cnt); } return 0; }题目地址:【杭电】[4349]Xiao Ming’s Hope