
Lv.1
只是喜欢Python而已……徒弟:程序侯
签名:只是喜欢Python而已…… 徒弟:程序侯
在 #万圣节活动 谁愿意和我组队 中回复
https://box3create.codemao.cn/games/04d68d93200f55d288ce
2020-10-24T16:39:29 点赞:0
在 【趣玩C语言·07】赋值运算符&关系运算符 中回复
#include <bits/stdc++.h>
using namespace std;
bool used [100] = {};int data[100];char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int n;
void dfs(int deep){
if(deep == n){
for(int i = 0;i < n;i++) putchar(letters[data[i]-1]);
putchar('\n');
return;
}
for(int i = 1;i <= n;i++)
if(!used[i]){
used[i] = true;
data[deep] = i;
dfs(deep+1);
used[i] = false;
data[deep] = -1;
}
}
int main(){
cin >> n;
dfs(0);
return 0;
}2020-10-31T19:55:55 点赞:0