mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 11:58:48 +00:00
801. 二进制中1的个数
https://www.acwing.com/problem/content/submission/code_detail/6604636/
This commit is contained in:
parent
3e82fa10c7
commit
56c90deb8b
15
AcWing/801/801.cpp
Normal file
15
AcWing/801/801.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user