Advertisement
codegod313

Apk #2 (Gleb)

Mar 23rd, 2021
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <ctime>
  2. #include <stdlib.h>
  3. #include <iostream>
  4. #include <iomanip>
  5. #include <numeric>
  6. #include <chrono>
  7. #define sizeMatrix 300
  8. #define cycleValue 100000
  9.  
  10. int main()
  11. {
  12.     //initialization
  13.     int matr[10000][10000], sum[10000];
  14.     for (int i = 0; i < 10000; i++)
  15.     {
  16.         for (int j = 0; j < 10000; j++)
  17.         {
  18.             matr[i][j] = rand() % 100;
  19.         }
  20.         sum[i] = 0;
  21.     }
  22.     //calculating sum of columns (result in sum[])
  23.     for (int i = 0; i < 10000; i++)
  24.     {
  25.         for (int j = 0; j < 10000; j++)
  26.         {
  27.             sum[i] += matr[j][i];
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement