static void Main(string[] args)
{
         string str=Console.ReadLine();
         Console.WriteLine(str);
int[] dest=new int[str.Length];
for(int i=1;i<str.Length;i++)
                  dest[i]=str[i-1]+3;
dest[0]=str[str.Length-1]+3;
for(int j=0;j<str.Length;j++)
Console.Write((char)dest[j]);
}
这样也行啊?

解决方案 »

  1.   

    好像有点强行的意思,不过Microsoft.VisualBasic名空间中有两个函数很好用,就是Asc()和Chr(),他们可以转换编码与字符,不过得引用Microsoft.VisualBasic.dll
      

  2.   

    C#中的确没有把整型转化为字符型的,但是可以把整型转化为字符串型

    int i=1234
    string hehe=i.ToString();
    Console.writeline(hehe);
    就可以得到1234
    但是有把字符和字符串转化为整型的函数

    //字符串-------正型
    int t=Convert.ToInt32(hehe);
    Console.writeline(hehe);
    //就可以得到1234
    //字符---------整形
    int t=Convert.ToInt32(hehe[0]);
    Console.writeline(t);
    你知道得到什么吗?得到49
    知道了这些,要写上面那个就很容易了.............