Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4. #include <complex>
  5.  
  6. int main(){
  7.     std::cout << "LOL\n";
  8.     std::complex<int> pos{119, 119};
  9.     int map[130][130];
  10.     for(int i = 0; i < 130; i ++)
  11.         for(int j = 0; j < 130; j++)
  12.             map[i][j] = 0;
  13.     map[pos.real()][pos.imag()] += 1;
  14.     for(int n = 0; n < 2; n++){
  15.         std::complex<int> temp{0, 0};
  16.         for(; temp.imag() <= 4; temp += std::complex<int>{0, 1})
  17.             map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
  18.         for(; temp.real() <= 6; temp += std::complex<int>{1, 0})
  19.             map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
  20.         for(; temp.imag() <= 6; temp += std::complex<int>{0, -1})
  21.             map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
  22.         for(; temp.real() <= 10; temp += std::complex<int>{-1, 0})
  23.             map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
  24.     }
  25.     int s = 0;
  26.     for(int i = 0; i < 130; i ++)
  27.         for(int j = 0; j < 130; j++)
  28.             if(map[i][j] == 2)
  29.                 s++;
  30.     std::cout << s  << "\nLOL\n";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement