Toxotsist

sin

Oct 28th, 2020 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int perm(int perm) {
  6.     double s = perm;
  7.     return (int (round((sin(s/10)*10))));
  8. }
  9.  
  10. int main() {
  11.     const int x = 120;
  12.     const int y = 21;
  13.     int matrix[x][y] = {0};
  14.     for (int k = 0; k < x; k++)
  15.     {
  16.         matrix[k][perm(k)-11]++;
  17.     }
  18.     for (int k = 0; k < y; k++) { matrix[63][k] = 2; }
  19.     for (int k = 0; k < x; k++) { matrix[k][10] = 2; }
  20.     for (int q = 0; q < y; q++)
  21.     {
  22.         for (int b = 0; b < x; b++)
  23.         {
  24.             if (matrix[b][q] == 1) { cout << "="; }
  25.             else {
  26.                 if (matrix[b][q] == 2) { cout << "="; }
  27.                 else { cout << "."; }
  28.             }
  29.         }
  30.     }
  31.     cout << matrix;
  32. }
Add Comment
Please, Sign In to add comment