fork download
  1. #include <iostream>
  2. #include <cstdint>
  3. #include <cmath>
  4.  
  5. double E24(double Arg) {
  6.  
  7. double P = Arg / 24;
  8. double S = std::sqrt(100 * P);
  9. double M = Arg / (24 / 9.0);
  10. double A = 10 + S * M;
  11. return std::round(A);
  12. }
  13. int main()
  14. {
  15. for (std::uint64_t i = 0; i <= 24; i++) {
  16. std::cout <<i<<" : "<<E24(i) << std::endl;
  17. }
  18. return 0;
  19. }
  20.  
  21.  
Success #stdin #stdout 0s 4236KB
stdin
Standard input is empty
stdout
0 : 10
1 : 11
2 : 12
3 : 14
4 : 16
5 : 19
6 : 21
7 : 24
8 : 27
9 : 31
10 : 34
11 : 38
12 : 42
13 : 46
14 : 50
15 : 54
16 : 59
17 : 64
18 : 68
19 : 73
20 : 78
21 : 84
22 : 89
23 : 94
24 : 100