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.

25 lines
321 B

#include<bits/stdc++.h>
using namespace std;
char a[9999999]= {0};
int main() {
int n,t,i,j,k;
scanf("%d",&n);
for(k=1; k<=n; k++) {
t=pow(2,k)/2;
a[t]='A'+k-1;
if(k>1) {
j=t+1;
for(i=t-1; i>0; i--) {
a[j]=a[i];
j++;
}
}
}
t=pow(2,n);
for(i=1; i<t; i++)
printf("%c",a[i]);
return 0;
}