输入一个字符串,然后把每个字母按字母表顺序后移3位,然后输出。
比如输入class,则输出fodvv。
我自己不会,请大家帮忙哦

解决方案 »

  1.   

    char[] c=new char[];
    c=Console.readline();
    foreach( char chr in c)
    {
     Console.write(char(int(chr)+3));}
      

  2.   

    using System;
    public class Abc{
    public static void Main(){
    String read = Console.ReadLine();
    for(int i = 0; i < read.Length; i++){
    Char a = read[i];
    Int32 code = (int)a;
    code = code + 3;
    Console.Write((char)code);
    }
    }
    }
      

  3.   

    谢谢楼上,等以后又分了再给你分顺便问一下,为什么用Console.write(char(int(chr)+3))会出错呢?
      

  4.   

    Console.write
    是控制台(DOS)程序输出
    这都不知道,比我还笨
      

  5.   

    我是说(char(int(chr)+3))编译时会出错
    我最开始也是这样写的,为什么一定要分开一步一步写?