- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Excise01
- {
- class Program
- {
- static void Main(string[] args)
- {
- string str = "Hello";
- char[] ss = new char[str.Length];
- int i = 0;
- foreach (char s in str)
- {
- ss[i] = s;
- ++i;
- }
- for (int j = str.Length-1; j >=0; j--)
- {
- Console.Write(" " + ss[j]);
- }
- Console.ReadLine();
- }
- }
- }
C# 实现字符串颠倒
最新推荐文章于 2023-01-14 21:00:00 发布