- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace reverse
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = "hello c sharp";
- string[] SepInput = input.Split(' ');
- string output="" ;
- for (int i = 0; i < SepInput.Length; i++)
- {
- int length = SepInput[i].Length;
- for (int j = 0; j < length ; j++)
- {
- output+= SepInput[i][length - j - 1];
- }
- output += " ";
- }
- Console.WriteLine(output);
- }
- }
- }
复制代码
现写的,希望参考 |