1 条题解

  • 0
    @ 2025-7-24 11:18:55
    using namespace std;
    unsigned int cnt,tmp,sum,i;
    int t;
    int main(){
    	while(cin>>t){
    		sum=0;
    		while(t--){
    			cin>>tmp;
    			cnt=0;
    			while(tmp){
    				if(tmp&1)cnt++;
    				tmp=tmp>>1;
    			}
    			sum+=cnt;
    		}
    		i++;
    		cout<<"Case #"<<i<<": "<<sum<<"\n";
    	}
    	return 0;
    }
    
    

    信息

    ID
    1220
    时间
    1000ms
    内存
    32MiB
    难度
    6
    标签
    递交数
    113
    已通过
    37
    上传者