文章
5
粉丝
138
获赞
6
访问
27.0k
#include <cstdio>
using namespace std;
int P[6];
void dfs(int index) {
if (index == 6) {
for (int i = 0; i <= 5; i++) {
printf("%d", P[i]);
}
printf("\n");
return;
}
for (int i = 0; i <= 1; i++) {
P[index] = i;
dfs(index + 1);
}
}
int main() {
dfs(0);
return 0;
}
#include <cstdio>
using namespace std;
int main() {
for(int i = 0; i<=63; i++) {
int num[6] = {0};
int current = i;
int j = 0;
while(current) {
num[j++] = current&1;
current>>=1;
}
for (int k = 5; k>=0 ; k--) {
printf("%d", num[k]);
}
printf("\n");
}
return 0;
}
登录后发布评论
$\LaTeX$