0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:11:58 +00:00

801. 二进制中1的个数

https://www.acwing.com/problem/content/submission/code_detail/6604636/
This commit is contained in:
Baoshuo Ren 2021-07-22 15:27:37 +08:00 committed by Baoshuo Ren
parent 3e82fa10c7
commit 56c90deb8b
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

15
AcWing/801/801.cpp Normal file
View File

@ -0,0 +1,15 @@
#include <bits/stdc++.h>
using namespace std;
int n, t;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> t;
cout << __builtin_popcount(t) << ' ';
}
cout << endl;
return 0;
}