string s1 = "";
            Console.Write("请输入一个字符串:");
            s1 = Console.ReadLine();

            
            for (int i = 0; i < s1.Length; i++)
            {
                
                if ((int)s1[i] >= 97 && (int)s1[i] <= 119)
                {
                    int b = (int)s1[i] + 3;
                    Console.Write(" "+(char)b);
                }

                else if((int)s1[i] >=120 && (int)s1[i]<=122)
                {
                    int b = (int)s1[i] - 23;
                    Console.Write(" "+(char)b);

                }
                else if((int)s1[i] >= 65 && (int)s1[i]<=87)
                {
                    int b = (int)s1[i] + 3;
                    Console.Write(" " + (char)b);
                }
                else if ((int)s1[i] >= 88 && (int)s1[i] <= 90)
                {
                    int b = (int)s1[i] - 23;
                    Console.Write(" " + (char)b);
                }

对输入的字符进行转化

相关文章:

  • 2022-01-19
  • 2021-10-08
  • 2021-08-27
  • 2021-04-17
  • 2021-10-19
  • 2021-05-20
  • 2021-08-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案