标签:style http color io ar div sp 代码 on
代码:
#include<stdio.h> void f(int n,int &k) { if(n==1) return; k++; if(n&1) k++; n/=2; f(n,k); return; } int main() { int t,n,k,i; scanf("%d",&t); while(t--) { k=0; scanf("%d",&n); f(n,k); printf("%d\n",k); } return 0; }
标签:style http color io ar div sp 代码 on
原文地址:http://blog.csdn.net/qq_18062811/article/details/39431975