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 Form1 : Form
{
System.Windows.Forms.TextBox[] textboxs;
int[,] a = new int[5, 5];
int[,] b = new int[5, 5];
int[,] c = new int[5, 5];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textboxs = new System.Windows.Forms.TextBox[48];
for (int j = 0; j < 48; j++)
{
textboxs[j] = new TextBox();
this.Controls.Add(textboxs[j]);
if (j <= 3)
textboxs[j].Location = new System.Drawing.Point(10 + j * 110, 10);
else if (j > 3 && j <= 7)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 4) * 110, 40);
else if (j > 7 && j <= 11)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 8) * 110, 70);
else if (j > 11 && j <= 15)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 12) * 110, 100);
else if (j > 15 && j <= 19)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 16) * 110, 140);
else if (j > 19 && j <= 23)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 20) * 110, 170);
else if (j > 23 && j <= 27)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 24) * 110, 200);
else if (j > 27 && j <= 31)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 28) * 110, 230);
else if (j > 31 && j <= 35)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 32) * 110, 270);
else if (j > 35 && j <= 39)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 36) * 110, 300);
else if (j > 39 && j <= 43)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 40) * 110, 330);
else if (j > 43 && j <= 47)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 44) * 110, 360);
}
textboxs[0].Text = "1";
textboxs[1].Text = "0";
textboxs[2].Text = "0";
textboxs[3].Text = "0";
textboxs[4].Text = "0";
textboxs[5].Text = "1";
textboxs[6].Text = "0";
textboxs[7].Text = "0";
textboxs[8].Text = "0";
textboxs[9].Text = "0";
textboxs[10].Text = "1";
textboxs[11].Text = "0";
textboxs[12].Text = "0";
textboxs[13].Text = "0";
textboxs[14].Text = "0";
textboxs[15].Text = "1";
textboxs[16].Text = "1";
textboxs[17].Text = "0";
textboxs[18].Text = "0";
textboxs[19].Text = "0";
textboxs[20].Text = "0";
textboxs[21].Text = "1";
textboxs[22].Text = "0";
textboxs[23].Text = "0";
textboxs[24].Text = "0";
textboxs[25].Text = "0";
textboxs[26].Text = "1";
textboxs[27].Text = "0";
textboxs[28].Text = "0";
textboxs[29].Text = "0";
textboxs[30].Text = "0";
textboxs[31].Text = "1";
}
private void button1_Click(object sender, EventArgs e)
{
//輸入 intput
for (int i = 0; i < 16; i++)
{
if (i <= 3)
a[1, i + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 3 && i <= 7)
a[2, (i - 4) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 7 && i <= 11)
a[3, (i - 8) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 11 && i <= 15)
a[4, (i - 12) + 1] = Convert.ToInt16(textboxs[i].Text);
}
for (int i = 0; i < 16; i++)
{
if (i <= 3)
b[1, i + 1] = Convert.ToInt16(textboxs[(i + 16)].Text);
else if (i > 3 && i <= 7)
b[2, (i - 4) + 1] = Convert.ToInt16(textboxs[(i + 16)].Text);
else if (i > 7 && i <= 11)
b[3, (i - 8) + 1] = Convert.ToInt16(textboxs[(i + 16)].Text);
else if (i > 11 && i <= 15)
b[4, (i - 12) + 1] = Convert.ToInt16(textboxs[(i + 16)].Text);
}
c[1, 1] = a[1, 1] * b[1, 1] + a[1, 2] * b[2, 1] + a[1, 3] * b[3, 1] + a[1, 4] * b[4, 1];
c[1, 2] = a[1, 1] * b[1, 2] + a[1, 2] * b[2, 2] + a[1, 3] * b[3, 2] + a[1, 4] * b[4, 2];
c[1, 3] = a[1, 1] * b[1, 3] + a[1, 2] * b[2, 3] + a[1, 3] * b[3, 3] + a[1, 4] * b[4, 3];
c[1, 4] = a[1, 1] * b[1, 4] + a[1, 2] * b[2, 4] + a[1, 3] * b[3, 4] + a[1, 4] * b[4, 4];
c[2, 1] = a[2, 1] * b[1, 1] + a[2, 2] * b[2, 1] + a[2, 3] * b[3, 1] + a[2, 4] * b[4, 1];
c[2, 2] = a[2, 1] * b[1, 2] + a[2, 2] * b[2, 2] + a[2, 3] * b[3, 2] + a[2, 4] * b[4, 2];
c[2, 3] = a[2, 1] * b[1, 3] + a[2, 2] * b[2, 3] + a[2, 3] * b[3, 3] + a[2, 4] * b[4, 3];
c[2, 4] = a[2, 1] * b[1, 4] + a[2, 2] * b[2, 4] + a[2, 3] * b[3, 4] + a[2, 4] * b[4, 4];
c[3, 1] = a[3, 1] * b[1, 1] + a[3, 2] * b[2, 1] + a[3, 3] * b[3, 1] + a[3, 4] * b[4, 1];
c[3, 2] = a[3, 1] * b[1, 2] + a[3, 2] * b[2, 2] + a[3, 3] * b[3, 2] + a[3, 4] * b[4, 2];
c[3, 3] = a[3, 1] * b[1, 3] + a[3, 2] * b[2, 3] + a[3, 3] * b[3, 3] + a[3, 4] * b[4, 3];
c[3, 4] = a[3, 1] * b[1, 4] + a[3, 2] * b[2, 4] + a[3, 3] * b[3, 4] + a[3, 4] * b[4, 4];
c[4, 1] = a[4, 1] * b[1, 1] + a[4, 2] * b[2, 1] + a[4, 3] * b[3, 1] + a[4, 4] * b[4, 1];
c[4, 2] = a[4, 1] * b[1, 2] + a[4, 2] * b[2, 2] + a[4, 3] * b[3, 2] + a[4, 4] * b[4, 2];
c[4, 3] = a[4, 1] * b[1, 3] + a[4, 2] * b[2, 3] + a[4, 3] * b[3, 3] + a[4, 4] * b[4, 3];
c[4, 4] = a[4, 1] * b[1, 4] + a[4, 2] * b[2, 4] + a[4, 3] * b[3, 4] + a[4, 4] * b[4, 4];
textboxs[32].Text = "" + c[1, 1];
textboxs[33].Text = "" + c[1, 2];
textboxs[34].Text = "" + c[1, 3];
textboxs[35].Text = "" + c[1, 4];
textboxs[36].Text = "" + c[2, 1];
textboxs[37].Text = "" + c[2, 2];
textboxs[38].Text = "" + c[2, 3];
textboxs[39].Text = "" + c[2, 4];
textboxs[40].Text = "" + c[3, 1];
textboxs[41].Text = "" + c[3, 2];
textboxs[42].Text = "" + c[3, 3];
textboxs[43].Text = "" + c[3, 4];
textboxs[44].Text = "" + c[4, 1];
textboxs[45].Text = "" + c[4, 2];
textboxs[46].Text = "" + c[4, 3];
textboxs[47].Text = "" + c[4, 4];
}
}
}
2010年10月22日 星期五
44
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
System.Windows.Forms.TextBox[] textboxs;
int[,] a = new int[5, 5];
int[,] b = new int[5, 5];
int[,] c = new int[5, 5];
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
textboxs = new System.Windows.Forms.TextBox[48];
for (int j = 0; j < 48; j++)
{
textboxs[j] = new TextBox();
this.Controls.Add(textboxs[j]);
if (j <= 3)
textboxs[j].Location = new System.Drawing.Point(10 + j * 110, 10);
else if (j > 3 && j <= 7)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 4) * 110, 40);
else if (j > 7 && j <= 11)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 8) * 110, 70);
else if (j > 11 && j <= 15)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 12) * 110, 100);
else if (j > 15 && j <= 19)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 16) * 110, 140);
else if (j > 19 && j <= 23)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 20) * 110, 170);
else if (j > 23 && j <= 27)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 24) * 110, 200);
else if (j > 27 && j <= 31)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 28) * 110, 230);
else if (j > 31 && j <= 35)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 32) * 110, 270);
else if (j > 35 && j <= 39)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 36) * 110, 300);
else if (j > 39 && j <= 43)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 40) * 110, 330);
else if (j > 43 && j <= 47)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 44) * 110, 360);
}
textboxs[0].Text = "1";
textboxs[1].Text = "0";
textboxs[2].Text = "0";
textboxs[3].Text = "0";
textboxs[4].Text = "0";
textboxs[5].Text = "1";
textboxs[6].Text = "0";
textboxs[7].Text = "0";
textboxs[8].Text = "0";
textboxs[9].Text = "0";
textboxs[10].Text = "1";
textboxs[11].Text = "0";
textboxs[12].Text = "0";
textboxs[13].Text = "0";
textboxs[14].Text = "0";
textboxs[15].Text = "1";
textboxs[16].Text = "1";
textboxs[17].Text = "0";
textboxs[18].Text = "0";
textboxs[19].Text = "0";
textboxs[20].Text = "0";
textboxs[21].Text = "1";
textboxs[22].Text = "0";
textboxs[23].Text = "0";
textboxs[24].Text = "0";
textboxs[25].Text = "0";
textboxs[26].Text = "1";
textboxs[27].Text = "0";
textboxs[28].Text = "0";
textboxs[29].Text = "0";
textboxs[30].Text = "0";
textboxs[31].Text = "1";
}
private void button1_Click(object sender, EventArgs e)
{
//輸入 intput
for (int i = 0; i < 16; i++)
{
if (i <= 3)
a[1, i + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 3 && i <= 7)
a[2, (i - 4) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 7 && i <= 11)
a[3, (i - 8) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 11 && i <= 15)
a[4, (i - 12) + 1] = Convert.ToInt16(textboxs[i].Text);
}
for (int i = 0; i < 16; i++)
{
if (i <= 3)
b[1, i + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 3 && i <= 7)
b[2, (i - 4) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 7 && i <= 11)
b[3, (i - 8) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 11 && i <= 15)
b[4, (i - 12) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
}
c[1, 1] = a[1, 1] * b[1, 1] + a[1, 2] * b[2, 1] + a[1, 3] * b[3, 1] + a[1, 4] * b[4, 1];
c[1, 2] = a[1, 1] * b[1, 2] + a[1, 2] * b[2, 2] + a[1, 3] * b[3, 2] + a[1, 4] * b[4, 2];
c[1, 3] = a[1, 1] * b[1, 3] + a[1, 2] * b[2, 3] + a[1, 3] * b[3, 3] + a[1, 4] * b[4, 3];
c[1, 4] = a[1, 1] * b[1, 4] + a[1, 2] * b[2, 4] + a[1, 3] * b[3, 4] + a[1, 4] * b[4, 4];
c[2, 1] = a[2, 1] * b[1, 1] + a[2, 2] * b[2, 1] + a[2, 3] * b[3, 1] + a[2, 4] * b[4, 1];
c[2, 2] = a[2, 1] * b[1, 2] + a[2, 2] * b[2, 2] + a[2, 3] * b[3, 2] + a[2, 4] * b[4, 2];
c[2, 3] = a[2, 1] * b[1, 3] + a[2, 2] * b[2, 3] + a[2, 3] * b[3, 3] + a[2, 4] * b[4, 3];
c[2, 4] = a[2, 1] * b[1, 4] + a[2, 2] * b[2, 4] + a[2, 3] * b[3, 4] + a[2, 4] * b[4, 4];
c[3, 1] = a[3, 1] * b[1, 1] + a[3, 2] * b[2, 1] + a[3, 3] * b[3, 1] + a[3, 4] * b[4, 1];
c[3, 2] = a[3, 1] * b[1, 2] + a[3, 2] * b[2, 2] + a[3, 3] * b[3, 2] + a[3, 4] * b[4, 2];
c[3, 3] = a[3, 1] * b[1, 3] + a[3, 2] * b[2, 3] + a[3, 3] * b[3, 3] + a[3, 4] * b[4, 3];
c[3, 4] = a[3, 1] * b[1, 4] + a[3, 2] * b[2, 4] + a[3, 3] * b[3, 4] + a[3, 4] * b[4, 4];
c[4, 1] = a[4, 1] * b[1, 1] + a[4, 2] * b[2, 1] + a[4, 3] * b[3, 1] + a[4, 4] * b[4, 1];
c[4, 2] = a[4, 1] * b[1, 2] + a[4, 2] * b[2, 2] + a[4, 3] * b[3, 2] + a[4, 4] * b[4, 2];
c[4, 3] = a[4, 1] * b[1, 3] + a[4, 2] * b[2, 3] + a[4, 3] * b[3, 3] + a[4, 4] * b[4, 3];
c[4, 4] = a[4, 1] * b[1, 4] + a[4, 2] * b[2, 4] + a[4, 3] * b[3, 4] + a[4, 4] * b[4, 4];
textboxs[32].Text = "" + c[1, 1];
textboxs[33].Text = "" + c[1, 2];
textboxs[34].Text = "" + c[1, 3];
textboxs[35].Text = "" + c[1, 4];
textboxs[36].Text = "" + c[2, 1];
textboxs[37].Text = "" + c[2, 2];
textboxs[38].Text = "" + c[2, 3];
textboxs[39].Text = "" + c[2, 4];
textboxs[40].Text = "" + c[3, 1];
textboxs[41].Text = "" + c[3, 2];
textboxs[42].Text = "" + c[3, 3];
textboxs[43].Text = "" + c[3, 4];
textboxs[44].Text = "" + c[4, 1];
textboxs[45].Text = "" + c[4, 2];
textboxs[46].Text = "" + c[4, 3];
textboxs[47].Text = "" + c[4, 4];
}
}
}
{
public partial class Form2 : Form
{
System.Windows.Forms.TextBox[] textboxs;
int[,] a = new int[5, 5];
int[,] b = new int[5, 5];
int[,] c = new int[5, 5];
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
textboxs = new System.Windows.Forms.TextBox[48];
for (int j = 0; j < 48; j++)
{
textboxs[j] = new TextBox();
this.Controls.Add(textboxs[j]);
if (j <= 3)
textboxs[j].Location = new System.Drawing.Point(10 + j * 110, 10);
else if (j > 3 && j <= 7)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 4) * 110, 40);
else if (j > 7 && j <= 11)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 8) * 110, 70);
else if (j > 11 && j <= 15)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 12) * 110, 100);
else if (j > 15 && j <= 19)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 16) * 110, 140);
else if (j > 19 && j <= 23)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 20) * 110, 170);
else if (j > 23 && j <= 27)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 24) * 110, 200);
else if (j > 27 && j <= 31)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 28) * 110, 230);
else if (j > 31 && j <= 35)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 32) * 110, 270);
else if (j > 35 && j <= 39)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 36) * 110, 300);
else if (j > 39 && j <= 43)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 40) * 110, 330);
else if (j > 43 && j <= 47)
textboxs[j].Location = new System.Drawing.Point(10 + (j - 44) * 110, 360);
}
textboxs[0].Text = "1";
textboxs[1].Text = "0";
textboxs[2].Text = "0";
textboxs[3].Text = "0";
textboxs[4].Text = "0";
textboxs[5].Text = "1";
textboxs[6].Text = "0";
textboxs[7].Text = "0";
textboxs[8].Text = "0";
textboxs[9].Text = "0";
textboxs[10].Text = "1";
textboxs[11].Text = "0";
textboxs[12].Text = "0";
textboxs[13].Text = "0";
textboxs[14].Text = "0";
textboxs[15].Text = "1";
textboxs[16].Text = "1";
textboxs[17].Text = "0";
textboxs[18].Text = "0";
textboxs[19].Text = "0";
textboxs[20].Text = "0";
textboxs[21].Text = "1";
textboxs[22].Text = "0";
textboxs[23].Text = "0";
textboxs[24].Text = "0";
textboxs[25].Text = "0";
textboxs[26].Text = "1";
textboxs[27].Text = "0";
textboxs[28].Text = "0";
textboxs[29].Text = "0";
textboxs[30].Text = "0";
textboxs[31].Text = "1";
}
private void button1_Click(object sender, EventArgs e)
{
//輸入 intput
for (int i = 0; i < 16; i++)
{
if (i <= 3)
a[1, i + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 3 && i <= 7)
a[2, (i - 4) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 7 && i <= 11)
a[3, (i - 8) + 1] = Convert.ToInt16(textboxs[i].Text);
else if (i > 11 && i <= 15)
a[4, (i - 12) + 1] = Convert.ToInt16(textboxs[i].Text);
}
for (int i = 0; i < 16; i++)
{
if (i <= 3)
b[1, i + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 3 && i <= 7)
b[2, (i - 4) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 7 && i <= 11)
b[3, (i - 8) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
else if (i > 11 && i <= 15)
b[4, (i - 12) + 1] = Convert.ToInt16(textboxs[(i+16)].Text);
}
c[1, 1] = a[1, 1] * b[1, 1] + a[1, 2] * b[2, 1] + a[1, 3] * b[3, 1] + a[1, 4] * b[4, 1];
c[1, 2] = a[1, 1] * b[1, 2] + a[1, 2] * b[2, 2] + a[1, 3] * b[3, 2] + a[1, 4] * b[4, 2];
c[1, 3] = a[1, 1] * b[1, 3] + a[1, 2] * b[2, 3] + a[1, 3] * b[3, 3] + a[1, 4] * b[4, 3];
c[1, 4] = a[1, 1] * b[1, 4] + a[1, 2] * b[2, 4] + a[1, 3] * b[3, 4] + a[1, 4] * b[4, 4];
c[2, 1] = a[2, 1] * b[1, 1] + a[2, 2] * b[2, 1] + a[2, 3] * b[3, 1] + a[2, 4] * b[4, 1];
c[2, 2] = a[2, 1] * b[1, 2] + a[2, 2] * b[2, 2] + a[2, 3] * b[3, 2] + a[2, 4] * b[4, 2];
c[2, 3] = a[2, 1] * b[1, 3] + a[2, 2] * b[2, 3] + a[2, 3] * b[3, 3] + a[2, 4] * b[4, 3];
c[2, 4] = a[2, 1] * b[1, 4] + a[2, 2] * b[2, 4] + a[2, 3] * b[3, 4] + a[2, 4] * b[4, 4];
c[3, 1] = a[3, 1] * b[1, 1] + a[3, 2] * b[2, 1] + a[3, 3] * b[3, 1] + a[3, 4] * b[4, 1];
c[3, 2] = a[3, 1] * b[1, 2] + a[3, 2] * b[2, 2] + a[3, 3] * b[3, 2] + a[3, 4] * b[4, 2];
c[3, 3] = a[3, 1] * b[1, 3] + a[3, 2] * b[2, 3] + a[3, 3] * b[3, 3] + a[3, 4] * b[4, 3];
c[3, 4] = a[3, 1] * b[1, 4] + a[3, 2] * b[2, 4] + a[3, 3] * b[3, 4] + a[3, 4] * b[4, 4];
c[4, 1] = a[4, 1] * b[1, 1] + a[4, 2] * b[2, 1] + a[4, 3] * b[3, 1] + a[4, 4] * b[4, 1];
c[4, 2] = a[4, 1] * b[1, 2] + a[4, 2] * b[2, 2] + a[4, 3] * b[3, 2] + a[4, 4] * b[4, 2];
c[4, 3] = a[4, 1] * b[1, 3] + a[4, 2] * b[2, 3] + a[4, 3] * b[3, 3] + a[4, 4] * b[4, 3];
c[4, 4] = a[4, 1] * b[1, 4] + a[4, 2] * b[2, 4] + a[4, 3] * b[3, 4] + a[4, 4] * b[4, 4];
textboxs[32].Text = "" + c[1, 1];
textboxs[33].Text = "" + c[1, 2];
textboxs[34].Text = "" + c[1, 3];
textboxs[35].Text = "" + c[1, 4];
textboxs[36].Text = "" + c[2, 1];
textboxs[37].Text = "" + c[2, 2];
textboxs[38].Text = "" + c[2, 3];
textboxs[39].Text = "" + c[2, 4];
textboxs[40].Text = "" + c[3, 1];
textboxs[41].Text = "" + c[3, 2];
textboxs[42].Text = "" + c[3, 3];
textboxs[43].Text = "" + c[3, 4];
textboxs[44].Text = "" + c[4, 1];
textboxs[45].Text = "" + c[4, 2];
textboxs[46].Text = "" + c[4, 3];
textboxs[47].Text = "" + c[4, 4];
}
}
}
2010年10月8日 星期五
11
sing 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 Form1 : Form
{
Form2 newform;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a,b,c;
string output;
a = int.Parse(textBox1.Text);
b = int.Parse(textBox2.Text);
c=a*b;
output = Convert.ToString(c);
textBox3.Text = output;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
newform= new Form2();
newform.Show();
}
}
}
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 Form1 : Form
{
Form2 newform;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a,b,c;
string output;
a = int.Parse(textBox1.Text);
b = int.Parse(textBox2.Text);
c=a*b;
output = Convert.ToString(c);
textBox3.Text = output;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
newform= new Form2();
newform.Show();
}
}
}
33
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 button1_Click(object sender, EventArgs e)
{
int[,] a = new int[4, 4];
int[,] b = new int[4, 4];
int[,] c = new int[4, 4];
a[1, 1] = int.Parse(textBox1.Text);
a[1, 2] = int.Parse(textBox14.Text);
a[1, 3] = int.Parse(textBox11.Text);
a[2, 1] = int.Parse(textBox2.Text);
a[2, 2] = int.Parse(textBox8.Text);
a[2, 3] = int.Parse(textBox12.Text);
a[3, 1] = int.Parse(textBox9.Text);
a[3, 2] = int.Parse(textBox3.Text);
a[3, 3] = int.Parse(textBox15.Text);
b[1, 1] = int.Parse(textBox19.Text);
b[1, 2] = int.Parse(textBox20.Text);
b[1, 3] = int.Parse(textBox22.Text);
b[2, 1] = int.Parse(textBox21.Text);
b[2, 2] = int.Parse(textBox25.Text);
b[2, 3] = int.Parse(textBox26.Text);
b[3, 1] = int.Parse(textBox24.Text);
b[3, 2] = int.Parse(textBox23.Text);
b[3, 3] = int.Parse(textBox27.Text);
c[1,1]= a[1,1]*b[1,1]+a[1,2]*b[2,1]+a[1,3]*b[3,1];
c[1,2]= a[1,1]*b[1,2]+a[1,2]*b[2,2]+a[1,3]*b[3,2];
c[1,3]= a[1,1]*b[1,3]+a[1,2]*b[2,3]+a[1,3]*b[3,3];
c[2,1]= a[2,1]*b[1,1]+a[2,2]*b[2,1]+a[2,3]*b[3,1];
c[2,2]= a[2,1]*b[1,2]+a[2,2]*b[2,2]+a[2,3]*b[3,2];
c[2,3]= a[2,1]*b[1,3]+a[2,2]*b[2,3]+a[2,3]*b[3,3];
c[3,1]= a[3,1]*b[1,1]+a[3,2]*b[2,1]+a[3,3]*b[3,1];
c[3,2]= a[3,1]*b[1,2]+a[3,2]*b[2,2]+a[3,3]*b[3,2];
c[3,3]= a[3,1]*b[1,3]+a[3,2]*b[2,3]+a[3,3]*b[3,3];
textBox5.Text = Convert.ToString(c[1,1]);
textBox6.Text =Convert.ToString(c[1,2]);
textBox16.Text = Convert.ToString(c[1,3]);
textBox4.Text = Convert.ToString(c[2,1]);
textBox13.Text = Convert.ToString(c[2,2]);
textBox17.Text = Convert.ToString(c[2,3]);
textBox10.Text = Convert.ToString(c[3,1]);
textBox7.Text = Convert.ToString(c[3,2]);
textBox18.Text = Convert.ToString(c[3, 3]);
}
private void textBox13_TextChanged(object sender, EventArgs e)
{
}
private void textBox10_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
}
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 button1_Click(object sender, EventArgs e)
{
int[,] a = new int[4, 4];
int[,] b = new int[4, 4];
int[,] c = new int[4, 4];
a[1, 1] = int.Parse(textBox1.Text);
a[1, 2] = int.Parse(textBox14.Text);
a[1, 3] = int.Parse(textBox11.Text);
a[2, 1] = int.Parse(textBox2.Text);
a[2, 2] = int.Parse(textBox8.Text);
a[2, 3] = int.Parse(textBox12.Text);
a[3, 1] = int.Parse(textBox9.Text);
a[3, 2] = int.Parse(textBox3.Text);
a[3, 3] = int.Parse(textBox15.Text);
b[1, 1] = int.Parse(textBox19.Text);
b[1, 2] = int.Parse(textBox20.Text);
b[1, 3] = int.Parse(textBox22.Text);
b[2, 1] = int.Parse(textBox21.Text);
b[2, 2] = int.Parse(textBox25.Text);
b[2, 3] = int.Parse(textBox26.Text);
b[3, 1] = int.Parse(textBox24.Text);
b[3, 2] = int.Parse(textBox23.Text);
b[3, 3] = int.Parse(textBox27.Text);
c[1,1]= a[1,1]*b[1,1]+a[1,2]*b[2,1]+a[1,3]*b[3,1];
c[1,2]= a[1,1]*b[1,2]+a[1,2]*b[2,2]+a[1,3]*b[3,2];
c[1,3]= a[1,1]*b[1,3]+a[1,2]*b[2,3]+a[1,3]*b[3,3];
c[2,1]= a[2,1]*b[1,1]+a[2,2]*b[2,1]+a[2,3]*b[3,1];
c[2,2]= a[2,1]*b[1,2]+a[2,2]*b[2,2]+a[2,3]*b[3,2];
c[2,3]= a[2,1]*b[1,3]+a[2,2]*b[2,3]+a[2,3]*b[3,3];
c[3,1]= a[3,1]*b[1,1]+a[3,2]*b[2,1]+a[3,3]*b[3,1];
c[3,2]= a[3,1]*b[1,2]+a[3,2]*b[2,2]+a[3,3]*b[3,2];
c[3,3]= a[3,1]*b[1,3]+a[3,2]*b[2,3]+a[3,3]*b[3,3];
textBox5.Text = Convert.ToString(c[1,1]);
textBox6.Text =Convert.ToString(c[1,2]);
textBox16.Text = Convert.ToString(c[1,3]);
textBox4.Text = Convert.ToString(c[2,1]);
textBox13.Text = Convert.ToString(c[2,2]);
textBox17.Text = Convert.ToString(c[2,3]);
textBox10.Text = Convert.ToString(c[3,1]);
textBox7.Text = Convert.ToString(c[3,2]);
textBox18.Text = Convert.ToString(c[3, 3]);
}
private void textBox13_TextChanged(object sender, EventArgs e)
{
}
private void textBox10_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
}
2010年10月1日 星期五
99*******
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)
{
}
}
}
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)
{
}
}
}
99x
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 button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=9 ");
listBox1.Items.Add("2*1=2 2*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=18");
listBox1.Items.Add("3*1=3 3*2=6 3*3=9 3*4=12 3*5=15 3*6=18 3*7=21 3*8=24 3*9=27");
listBox1.Items.Add("4x1=4 4x2=8 4x3=12 4x4=16 4x5=20 4x6=24 4x7=28 4x8=32 4x9=36");
listBox1.Items.Add("5x1=5 5x2=10 5x3=15 5x4=20 5x5=25 5x6=30 5x7=35 5x8=40 5x9=45");
listBox1.Items.Add("6x1=6 6x2=12 6x3=18 6x4=24 6x5=30 6x6=36 6x7=42 6x8=48 6x9=54");
listBox1.Items.Add("7x1=7 7x2=14 7x3=21 7x4=28 7x5=35 7x6=42 7x7=49 7x8=56 7x9=63");
listBox1.Items.Add("8x1=8 8x2=16 8x3=24 8x4=32 8x5=40 8x6=48 8x7=56 8x8=64 8x9=72");
listBox1.Items.Add("9x1=9 9x2=18 9x3=27 9x4=36 9x5=45 9x6=54 9x7=63 9x8=72 9x9=81");
}
}
}
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 button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=9 ");
listBox1.Items.Add("2*1=2 2*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=18");
listBox1.Items.Add("3*1=3 3*2=6 3*3=9 3*4=12 3*5=15 3*6=18 3*7=21 3*8=24 3*9=27");
listBox1.Items.Add("4x1=4 4x2=8 4x3=12 4x4=16 4x5=20 4x6=24 4x7=28 4x8=32 4x9=36");
listBox1.Items.Add("5x1=5 5x2=10 5x3=15 5x4=20 5x5=25 5x6=30 5x7=35 5x8=40 5x9=45");
listBox1.Items.Add("6x1=6 6x2=12 6x3=18 6x4=24 6x5=30 6x6=36 6x7=42 6x8=48 6x9=54");
listBox1.Items.Add("7x1=7 7x2=14 7x3=21 7x4=28 7x5=35 7x6=42 7x7=49 7x8=56 7x9=63");
listBox1.Items.Add("8x1=8 8x2=16 8x3=24 8x4=32 8x5=40 8x6=48 8x7=56 8x8=64 8x9=72");
listBox1.Items.Add("9x1=9 9x2=18 9x3=27 9x4=36 9x5=45 9x6=54 9x7=63 9x8=72 9x9=81");
}
}
}
listbox 99
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 Form1 : Form
{
Form2 newform;
public Form1()
{
InitializeComponent();
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int a1,d,n,an ;
a1=int.Parse(textBox1.Text);
d=int.Parse(textBox2.Text);
n=int.Parse(textBox3.Text);
an=a1+(n-1)*d;
textBox4.Text = "" + an;
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
newform = new Form2();
newform.Show();
}
}
}
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 Form1 : Form
{
Form2 newform;
public Form1()
{
InitializeComponent();
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int a1,d,n,an ;
a1=int.Parse(textBox1.Text);
d=int.Parse(textBox2.Text);
n=int.Parse(textBox3.Text);
an=a1+(n-1)*d;
textBox4.Text = "" + an;
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
newform = new Form2();
newform.Show();
}
}
}
訂閱:
文章 (Atom)