using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace ConsoleApp6
{
internal class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
string[] arr = input.Split();
int[] numarr = Array.ConvertAll(arr, int.Parse);
int L = numarr[0];
int N = numarr[1];
int total = (int)Math.Pow(26, L);
int idx = total - N;
string final_str = "";
while (idx > 0)
{
int left = idx % 26;
final_str = (char)('a' + left) + final_str;
idx /= 26;
}
int len = final_str.Length;
if (len < L)
{
for (int i = 0; i < L - len; i++)
{
final_str = "a" + final_str;
}
}
Console.WriteLine(final_str);
}
}
}
pintia倒数第N个字符串
最新推荐文章于 2024-09-15 19:46:31 发布