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类型的切割功能。
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类型的切割功能。