提交时间:2023-10-28 08:46:47

运行 ID: 107711

#include<iostream> using namespace std; int a,b[100]; bool c[20]; void cc() { for(int k=1;k<=a;k++) cout<<b[k]; cout<<endl; a++; } int aa(int x) { int y; if(x>0) cc(); else for(y=1;y<=a;y++) if(b[y]==0) { c[y]=x; aa(x+1); c[y]=0; } } int main() { cin>>a; int b1,c1=0; for(b1=1;b<=a;b1++) c1+=b1; cout<<c1; return 0; }