protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "";
int[] shuju = { 32, 23, 16, 78, 5, 19, 41 };
for (int i = 0; i < shuju.Length; i++)
{
Label1.Text += shuju[i] + " ";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
int[] shuju = { 32, 23, 16, 78, 5, 19, 41 };
int max = 0;
for (int i = 1; i < shuju.Length; i++)
{
if (shuju[i] < shuju[i - 1])
{
max = shuju[i - 1];
shuju[i - 1] = shuju[i];
shuju[i] = max;
}
Label2.Text = "最大的数是:"+max.ToString();
}
}