SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. constexpr int SIZE = 3;
  4.  
  5. int main()
  6. {
  7.     double A[SIZE][SIZE] = {0};
  8.     double B[SIZE][SIZE] = {0};
  9.  
  10.     for (int i = 0; i < SIZE; ++i)
  11.         for (int j = 0; j < SIZE; ++j)
  12.             std::cin >> A[i][j];
  13.     for (int k = 0; k < SIZE; ++k)
  14.         for (int l = 0; l < SIZE; ++l) {
  15.             for (int i = 0; i <= k; ++i) {
  16.                 for (int j = 0; j <= l; ++j) {
  17.                     B[k][l] += A[i][j];
  18.                 }
  19.             }
  20.         }
  21.  
  22.     for (int i = 0; i < SIZE; ++i) {
  23.         for (int j = 0; j < SIZE; ++j)
  24.             std::cout << B[i][j] << " ";
  25.         std::cout << std::endl;
  26.     }
  27.  
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top