Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main()
  8. {
  9.     int n = 2;
  10.     cout << "Hello world!" << endl;
  11.     cout << "DAMIAN UJMA CZESTOCHOWA" << endl;
  12.     int A[n][n] = { {1,2},
  13.                     {3,4}};
  14.     int B[n][n] = { {1,1},
  15.                     {1,1}};
  16.     int C[n][n];
  17.  
  18.  
  19.     for(int i = 0 ; i < n; i++){
  20.         for(int j = 0; j < n; j++){
  21.             C[i][j] = A[i][j] + B[i][j];
  22.         }
  23.     }
  24.  
  25.     for(int i = 0 ; i < n; i++){
  26.         for(int j = 0; j < n; j++){
  27.             cout << C[i][j];
  28.         }
  29.         cout << endl;
  30.     }
  31.  
  32.     for(int i = 0 ; i < n; i++){
  33.         for(int j = 0; j < n; j++){
  34.             C[i][j] = A[i][j] + B[i][j];
  35.         }
  36.     }
  37.  
  38.  
  39.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement