fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. double g(double v) {return floor(v + .2);}
  6. int main() {
  7. double c = 1000. / sqrt(sqrt(2.));
  8. for (int ic = 0; ic <= 10; ++ic, c /= sqrt(2.)) {
  9. std::cout << "[A" << ic << ':' << g(c) << ' ' << g(sqrt(2.) * c) << "], "
  10. "[B" << ic << ':' << g(sqrt(3. / 2.) * c) << ' ' << g(sqrt(3.) * c) << "]\n";
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
[A0:841 1189], [B0:1030 1456]
[A1:594 841], [B1:728 1030]
[A2:420 594], [B2:515 728]
[A3:297 420], [B3:364 515]
[A4:210 297], [B4:257 364]
[A5:148 210], [B5:182 257]
[A6:105 148], [B6:128 182]
[A7:74 105], [B7:91 128]
[A8:52 74], [B8:64 91]
[A9:37 52], [B9:45 64]
[A10:26 37], [B10:32 45]