Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <complex>
- int main(){
- std::cout << "LOL\n";
- std::complex<int> pos{119, 119};
- int map[130][130];
- for(int i = 0; i < 130; i ++)
- for(int j = 0; j < 130; j++)
- map[i][j] = 0;
- map[pos.real()][pos.imag()] += 1;
- for(int n = 0; n < 2; n++){
- std::complex<int> temp{0, 0};
- for(; temp.imag() <= 4; temp += std::complex<int>{0, 1})
- map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
- for(; temp.real() <= 6; temp += std::complex<int>{1, 0})
- map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
- for(; temp.imag() <= 6; temp += std::complex<int>{0, -1})
- map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
- for(; temp.real() <= 10; temp += std::complex<int>{-1, 0})
- map[pos.real() + temp.real()][pos.imag() + temp.imag()] += 1;
- }
- int s = 0;
- for(int i = 0; i < 130; i ++)
- for(int j = 0; j < 130; j++)
- if(map[i][j] == 2)
- s++;
- std::cout << s << "\nLOL\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement