首页 > 代码库 > Excel Sheet Column Title

Excel Sheet Column Title

  public String convertToTitle(int n) {        String res="";        while(n>26)        {            if(n%26==0)            {                res="Z"+res;                n--;            }            else                res=((char)(n%26+64))+res;                        n/=26;        }                res=(char)(n+64)+res;        return res;    }

 

Excel Sheet Column Title