ustify">//int a=0; (int j=0; j lt; 3; j ++)
{
//a +=matrix1.a [j, k] * matrix2.a [i, j] ;. a [i, k] +=matrix1.a [j, k] * matrix2.a [i, j];
}
//NewMatrix.a [i, k]=a;
}
} NewMatrix;
}
//заполненіеvoid Zapoln (DataGridView grid)
{(int i=0; i lt; 3; i ++)
{(int j=0; j lt; 3; j ++)
{[i, j]=Convert. ToInt32 (grid. Rows [j] .Cells [i] .Value);
}
}
}
}
}
. csSystem; System. Collections. Generic; System. ComponentModel; System. Data; System. Drawing; System. Linq; System. Text; System. Windows. Forms;
Matrix
{partial class Form1: Form
{Form1 ()
{();
}
void Form1_Load (object sender, EventArgs e)
{(int i=0; i lt; 3; i ++)
{. Rows. Add () ;. Rows. Add () ;. Rows. Add ();
//dataGridView1. Rows [i] .Cells [0] .Value=i. ToString ();
}
}
void button1_Click (object sender, EventArgs e)
{matrix1=new MyMatrix (); matrix2=new MyMatrix (); matrix3 ;. Zapoln (dataGridView1) ;. Zapoln (dataGridView2);=(matrix1 + matrix2) ;. FullVisual (dataGridView3);
}
void button2_Click (object sender, EventArgs e)
{matrix1=new MyMatrix (); matrix2=new MyMatrix (); matrix3 ;. Zapoln (dataGridView1) ;. Zapoln (dataGridView2);=(matrix1 - matrix2) ;. FullVisual (dataGridView3);
}
void button3_Click (object sender, EventArgs e)
{matrix1=new MyMatrix (); matrix3 ;. Zapoln (dataGridView1);=matrix1. Trans () ;. FullVisual (dataGridView3);
}
void button4_Click (object sender, EventArgs e)
{matrix1=new MyMatrix (); matrix2=new MyMatrix (); matrix3 ;. Zapoln (dataGridView1) ;. Zapoln (dataGridView2);=(matrix1 * matrix2) ;. FullVisual (dataGridView3);
}
}
}