本人菜鸟,利用 for 语句给数组赋值并用 for 语句输出,源程序如下,哪里出错了呢
private void button2_Click(object sender, EventArgs e){
for (int i = 0; i < 6; i++)
{
a[i] = Convert.ToInt32(p.Text);
}
}
private void button1_Click(object sender, EventArgs e)
{
int j = 0;
for (j = 0; j < 6; j++)
{
label1.Text += (a[j]);
}
}