写一段伪代码,瞧瞧:
for(int i;i<inputnumber;i++)
{
   while(i.length <3)
       i ="0"+ i;
}

解决方案 »

  1.   

    select '010-'+convert(varchar,convert(int,max(right(field,3)))+1) from tb where left(field,3)='010'
      

  2.   

    select right('000'+convert(varchar,10),3)
      

  3.   

    select right('000'+convert(varchar,99),3)
      

  4.   

    using System;namespace ConsoleApplication6
    {
        class Program
        {
            static string fun(int i)
            {
                string res = i.ToString();
                while (res.Length < 3)
                    res = "0" + res;
                return res;        }
            static void Main(string[] args)
            {
                int i = 8;
                Console.WriteLine(fun(i));
            }
        }
    }
    我写了,你试试吧