标签:bsp 计算 code i++ color stream int for log
#include<iostream> #include<string.h> #include<cstdlib> using namespace std; char a[33]; int countOfZeros(int n) { int count=0; itoa(n,a,2); int len=strlen(a); //cout<<a<<" "<<len<<endl; for(int i=0;i<len;i++) if(a[i]==‘0‘) count++; return count; } int main() { int num; cin>>num; cout<<countOfZeros(num)<<endl; }
标签:bsp 计算 code i++ color stream int for log
原文地址:http://www.cnblogs.com/wft1990/p/6537264.html