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]);
}
这样也行啊?
{
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]);
}
这样也行啊?
如
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
知道了这些,要写上面那个就很容易了.............