Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : Form
- {
- int rows = 2;
- int column = 2;
- int[,] matrix1 = new int[2, 2];
- int[,] matrix2 = new int[2, 2];
- int[,] matrix3 = new int[2, 2];
- public Form1()
- {
- InitializeComponent();
- }
- public int beräknaSumma()
- {
- for (int i = 0; i < rows; i++)
- {
- for (int j = 0; j < column; j++)
- {
- int a = 0;
- if (int.TryParse(box1.Text, box2.Text(j, i), out a))
- matrix1[i, j] = a;
- }
- }
- for (int i = 0; i < rows; i++)
- {
- for (int j = 0; j < column; j++)
- {
- int b = 0;
- matrix2[rows, column] = b;
- }
- }
- for (int i = 0; i < rows ; i++)
- {
- for (int j = 0; j < column; j++)
- {
- matrix3[rows, column] = matrix1[rows, column] + matrix2[rows, column];
- }
- }
- return beräknaSumma();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement