用C#编写一个程序:输入1个数,用数组的方法倒着输出.

2024-11-20 20:36:09
推荐回答(1个)
回答1:

C#字符串:反序输出:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace o
{
class Program
{

static void Main(string[] args)
{
string st = @"C:\Users\i-rons\Desktop\C#文?.txt";
char[] a = new char[] { };
a = st.ToArray();
a = a.Reverse().ToArray();
Console.WriteLine(a);
}
}
}
你的问题答案:是:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 泛型哦
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入你想要的数字:");
string st = Console.ReadLine();
char[] a = new char[] { };
a = st.ToArray();
a = a.Reverse().ToArray();
Console.WriteLine(a);
}
}
}