namespace xsgl
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//存放姓名和成绩人数
string [] name = new string[3];
float [] cj;
int num = 3;
string name1 = TextBox1.Text;
string[] name2 = System.Text.RegularExpressions.Regex.Split(name1, @"[ ]+");
for (int i = 0; i < num; i++)
{
name[i] = name2[i];
}
string cj1 = TextBox3.Text;
string[] cj2 = System.Text.RegularExpressions.Regex.Split(cj1, @"[ ]+");
cj = new float [num];
for (int i = 0; i < num; i++)
{
cj[i] = float.Parse(cj2[i]);
}
//排序
for (int i = 0; i < num; i++)
{
int j;
for (j = 0; j < num - 1 - i; j++)
{
if (cj[j] > cj[j + 1])
{
float temp = cj[j];
cj[j] = cj[j + 1];
cj[j + 1] = temp;
float Max = cj[j];
Label1.Text = Max.ToString();
}
}
}
}
}
}
麻烦大神帮我看一下,编译不报错,开始添加查询就报错,说是数组长度超限什么的