Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. public partial class Form1 : Form
  2.     {
  3.  
  4.         int rows = 2;
  5.         int column = 2;
  6.  
  7.         int[,] matrix1 = new int[2, 2];
  8.         int[,] matrix2 = new int[2, 2];
  9.         int[,] matrix3 = new int[2, 2];
  10.  
  11.         public Form1()
  12.         {
  13.             InitializeComponent();
  14.         }
  15.        
  16.  
  17.         public int beräknaSumma()
  18.         {
  19.  
  20.             for (int i = 0; i < rows; i++)
  21.             {
  22.                 for (int j = 0; j < column; j++)
  23.                 {
  24.                     int a = 0;
  25.                     if (int.TryParse(box1.Text, box2.Text(j, i), out a))
  26.                         matrix1[i, j] = a;
  27.                    
  28.                 }
  29.             }
  30.  
  31.             for (int i = 0; i < rows; i++)
  32.             {
  33.                 for (int j = 0; j < column; j++)
  34.                 {
  35.                     int b = 0;
  36.                     matrix2[rows, column] = b;
  37.                 }
  38.             }
  39.  
  40.             for (int i = 0; i < rows ; i++)
  41.             {
  42.                 for (int j = 0; j < column; j++)
  43.                 {
  44.                     matrix3[rows, column] = matrix1[rows, column] + matrix2[rows, column];
  45.  
  46.                 }
  47.             }
  48.             return beräknaSumma();
  49.          
  50.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement