题目
#include<stdio.h>
#include<math.h>
char *fun(int L, int n)
{
int a = 0, b = 0;
int i = 0, j = L, z = L - 1;
static char s[10] = { '\0' };
const char s0[27] = "abcdefghijklmnopqrstuvwxyz";
while (j--)
a += 25 * pow(26, i++);
b = a - n + 1;
while (b)
{
s[z--] = s0[b % 26];
b /= 26;
}
return s;
}
int main(void)
{
int L, N;
scanf("%d%d", &L, &N);
if (L < 2 || L > 6 || N > 100000)
return -1;
printf("%s\n", fun(L, N));
return 0;
}