using System;
namespace ConsoleApplication2
{
class Program
{
// 键盘输入一行字符串,倒序输出
static void Main(string[] args)
{
Console.WriteLine("请输入一行字符串:");
string str = Console.ReadLine();// 可以把字符串看成是只读的字符数组
for (int i = str.Length - 1; i >= 0; i-- )
{
Console.Write(str[i] + " ");
}
Console.ReadKey();
}
}
}
详细解决方案
键盘输入一行字符串,每个字符倒序输出
热度:24 发布时间:2024-01-17 03:37:26.0
相关解决方案