using System; using System.Collections.Generic; //No.327 アルファベット列 class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("0"); //A } else if (InputPattern == "Input2") { WillReturn.Add("25"); //Z } else if (InputPattern == "Input3") { WillReturn.Add("26"); //AA } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); long N = int.Parse(InputList[0]); //1桁目のAからZ が 0から25に対応 //2桁目のAからZ が 1から26に対応 //3桁目のAからZ が 1から26に対応 //周期は26なので剰余を使う //26進数に変換 var NumList = new List(); do { NumList.Add(N % 26); N /= 26; } while (N > 0); var sb = new System.Text.StringBuilder(); for (int I = NumList.Count - 1; 0 <= I; I--) { char wkChar = (char)('A' + (char)NumList[I]); if (I > 0) wkChar--; sb.Append(wkChar); } Console.WriteLine(sb.ToString()); } }