zoukankan      html  css  js  c++  java
  • C#转数字为大写字母

        /// <summary>   

      /// 数字转为字母   

      /// </summary>   

      /// <param name="value"></param>

        /// <returns></returns>   

      private string IntToMoreChar(int value)   

      {       

        string rtn = string.Empty;      

         List<int> iList = new List<int>();

            //To single Int       

        while (value / 26 != 0 || value % 26 != 0)        

       {            

            iList.Add(value % 26);       

            value /= 26;  

           }

            //Change 0 To 26      

         for (int j = 0; j < iList.Count - 1; j++)

        {           

           if (iList[j] == 0)        

             {           

                iList[j + 1] -= 1;   

                      iList[j] = 26;       

              }       

          }

            //Remove 0 at last     

          if (iList[iList.Count - 1] == 0)

            {            

        iList.Remove(iList[iList.Count - 1]);       

        }

            //To String  

           for (int j = iList.Count - 1; j >= 0; j--)  

           {         

          char c = (char)(iList[j] + 64);   

              rtn += c.ToString();       

        }

            return rtn;     }

  • 相关阅读:
    POJ 2486 Apple Tree(树形DP)
    HDOJ 4276 鬼吹灯 (树形DP)
    POJ 2923 Relocation(状态压缩DP)
    Vue,事件的修饰符
    Vye,v-if 和 v-show 显示隐藏的使用
    Vue,for循环的key值绑定
    Vue,v-for循环遍历方式
    Vue-class样式,style样式
    Vue,v-model双向事件绑定 及简易计算器练习
    uni-app 生命周期(下拉已解决)
  • 原文地址:https://www.cnblogs.com/yclnet/p/3261546.html
Copyright © 2011-2022 走看看