using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int[,] arr = new int[10, 10];
int sum = 0;
for (int j = 0; j < 9; j++)
for (int k = 0; k < 9; k++)
{
arr[j, k] = (j + 1) * (k + 1);
sum = arr[j, k];
//listBox1.Items.Add("arr[" + (j + 1) + "]" + "[" + (k + 1) + "]=" + sum);
}
for (int j = 0; j < 9; j++)
{
listBox1.Items.Add("" + arr[j, 0] + "," + arr[j, 1] + "," + arr[j, 2] + "," + arr[j, 3] + "," + arr[j, 4] + "," + arr[j, 5] + "," + arr[j, 6] + "," + arr[j, 7] + "," + arr[j, 8]);
}
}
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
沒有留言:
張貼留言