You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
264 B
13 lines
264 B
2 years ago
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int n = 5;
|
||
|
int s = 13;
|
||
|
for (int i = n - 1; i >= 0; i--) //5位
|
||
|
if (s & (1 << i)) //0还是非0
|
||
|
cout << 1 << " ";
|
||
|
else cout << 0 << " ";
|
||
|
return 0;
|
||
|
}
|