C#的问题 急急急

来源:百度知道 编辑:UC知道 时间:2024/06/11 06:20:28
把下面的字符串排列编译出来,谢谢,谢谢
hello
good morning
here is my name
what is that

good morning
hello
here is my name
what is that

哈,是按照字符串的首字母排序把,代码放给你:

class Program
{

static void Main(string[] args)
{
System.Data.DataTable DT = new System.Data.DataTable();
DT.Columns.Add("Title");
DT.Rows.Add("hello");
DT.Rows.Add("good morning");
DT.Rows.Add("here is my name");
DT.Rows.Add("what is that");
System.Data.DataView dv = new System.Data.DataView(DT);
dv.Sort = "Title";

for (int i = 0; i < DT.Rows.Count; i++)
{
Console.WriteLine(dv[i].Row.ItemArray[0].ToString());
}

Console.ReadLine();
}

}

不懂你在说什么.

Console.Writeln("hello");
Console.Writeln("good morning");
Console.Writeln("here is my name&qu