using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication6
{
public class solution
{
public static int n;
public static string TitletoNumber(int n)
{
var streamBuilder = new StringBuilder();
while(n >0)
{
streamBuilder.Insert(0,(char)((n-1)%26+'A'));
n =(n-1)/26;
}
return streamBuilder.ToString();
}
static void Main(string[] args)
{
TitletoNumber(1);
Console.WriteLine("You can get {1}",n,TitletoNumber(29));
Console.ReadKey();
}
}
}
个人的代码请参考