Advertisement
ivnikkk

Untitled

Jul 13th, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #define debug(tl) cerr<<#tl<<' '<<tl<<'\n';
  3. #include <iostream>
  4. #include <stdio.h>
  5. #include <math.h>
  6. //#include <windows.h>
  7. using namespace std;
  8. #define all(d) d.begin(), d.end()
  9. typedef long double ld;
  10. signed main() {
  11. /*
  12. #ifdef _DEBUG
  13.     freopen("input.txt", "r", stdin);
  14.     freopen("output.txt", "w", stdout);
  15. #endif
  16. */
  17.     ios_base::sync_with_stdio(false);
  18.     cin.tie(nullptr);
  19.     cout.tie(nullptr);
  20.     int w = 120, h = 30;
  21.     ld k1 = (ld)w / h, k2 = 11.00/24.00;
  22.     char* scr = new char[w * h + 1];
  23.     scr[w * h] = '\0';
  24.     for (int d = 0; d < 1000000; d++) {
  25.         for (int i = 0; i < w; i++) {
  26.             for (int j = 0; j < h; j++) {
  27.                 ld x = (ld)i / w * 2.0 - 1.0, y = (ld)j / h * 2.0 - 1.0;
  28.                 char c = ' ';
  29.                 x *= k1, x *= k2;
  30.                 x += tan(d*0.0008);
  31.                 if (x * x + y * y <= 0.5 && x * x + y * y >= 0.20) c = '@';
  32.                 scr[i + j * w] = c;
  33.             }
  34.         }
  35.         printf(scr);
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement