Advertisement
Erasyl_BKT_505

SHIFROVKA_ANALITIC

Apr 1st, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int b[500][500], c[500][500];
  5.  
  6. int main(){
  7.     int a[3][3] = { {3 ,2, 1},
  8.                     {2, 5, 3},
  9.                     {3, 4, 3}};
  10.     cout << "Sozdi bas arippen engiz: ";
  11.     string s; cin >> s;
  12.     int k = 0;
  13.     for(int j = 0; j < s.size()/3; j++){
  14.         for(int i = 0; i < 3; i++){
  15.             b[i][j] = s[k] - 65;
  16.             k++;
  17.         }
  18.     }
  19.     vector<int> v;
  20.     for(int x = 0; x < s.size()/3; x++){
  21.         for(int i = 0; i < 3; i++){
  22.             int s = 0;
  23.             for(int j = 0; j < 3; j++){
  24.                 s += a[i][j] * b[j][x];
  25.             }
  26.             v.push_back(s);
  27.         }
  28.     }
  29.     for(int i = 0; i < v.size(); i++){
  30.         cout << v[i] << ' ';
  31.     }
  32.     cout << '\n';
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement