- 博客(3)
- 收藏
- 关注
原创 2-4 1的数目
public class ch2_4 { static long f (long n){ long iCount=0; for(long i=0;i<=n;i++){ iCount += Count1InAInteger(i); } return iCount; } static long Count1InAInteger(long n){ long ...
2018-05-17 14:56:53 169
原创 2.2-不要被阶乘吓倒
public class ch2_2 { public static int Nzero1(int x){ int num=0; for(int i=1;i<=x;i++){ int j=i; while(j%5 == 0){ num++; j/=5; } } return num; } public static int Nzero2...
2018-05-17 14:47:41 136
原创 2.1-求二进制中1的个数
public class c2_1 { public static int Count1(int x){ int num=0; while(x!=0){ if( x%2 == 1 ) num++; x/=2; } return num; } public static int Count2(int x){...
2018-05-17 14:44:13 105
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人