I love you 转变为 I evol uoy

来源:互联网 发布:钣金外壳 软件 编辑:程序博客网 时间:2024/06/03 05:09
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StringDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = null;
            string str1 =Console.ReadLine();
            string[] space = str1.Split(' ');
            for (int i = 0; i < space.Length;i++ )
            {
                char[] ch=space[i].ToCharArray();
                for(int j=space[i].Length-1;j>=0;j--)
                {
                    str+=ch[j];
                }
                str += " ";
            }
            Console.WriteLine(str);   
                Console.ReadKey();
        }
    }
}

偶然间看到网友在提问,于是自己试了一下,上面是源代码用C#写的,其实也就是使用了一个string类型的切割功能。
0 0
原创粉丝点击