把下列代码改成VB代码
private string abc( int i)
{
string strs;
strs = null;
while ((i % 26) != 0 | i / 26 != 0)
{
if (i % 26 == 0)
{
ints = i / 26 - 1;
strs = (char)(96 + 26) + strs;
}
else
{
strs = (char)(96 + (i % 26)) + strs;
ints = i / 26;
}
}
return strs;
}

解决方案 »

  1.   

    vb代码如下:private function abc(byval i as long) as stringdim strs as string
    dim ints as longdo while (((i mod 26)!=0 ) or (i /26 )!=0)
      if((i mod 26)=0) then
         ints=i/26-1
         strs=chr(122) & strs
      else
         strs = chr((96 + (i % 26)) & strs
         ints = i / 26
      end if
    loop
    abc=strs
    End function
      

  2.   

    Pirvate Function abc(byval i as integer) as String
    Dim str as String
    Dim ints as Single'楼主代码中没有这个定义,假设单精度变量吧Do While (i Mod 26) <> 0 Or i / 26 <> 0
       If i mod 26 =0 Then
          ints = i / 26 - 1;
          strs = (96 + 26) & strs
       Else
          strs = (96 + (i Mod 26)) & strs;
          ints = i / 26
       End If
    Loopabc = strsEnd function'ints 这个变量从来都没有用到过,不知道干吗用的。