fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. float prob (float x) {
  6. float p = 1 + 3*(1-x) + 6*(1-x)*(1-x);
  7. p = x*x*x*p;
  8. return p;
  9. }
  10.  
  11. int main() {
  12. int rat1 = 1775, rat2 = 1818, rat3 = 1886, rat4 = 1845, rat5 = 2060, rat6 = 2079, rat7 = 2109;
  13. float x1, x2, x3, x4, x5, x6, x7, rating = 2293.19, res;
  14. x1 = 1/(1 + pow(10, (rat1 - rating)/400));
  15. x2 = 1/(1 + pow(10, (rat2 - rating)/400));
  16. x3 = 1/(1 + pow(10, (rat3 - rating)/400));
  17. x4 = 1/(1 + pow(10, (rat4 - rating)/400));
  18. x5 = 1/(1 + pow(10, (rat5 - rating)/400));
  19. x6 = 1/(1 + pow(10, (rat6 - rating)/400));
  20. x7 = 1/(1 + pow(10, (rat7 - rating)/400));
  21. res = prob(x1)*prob(x2)*prob(x3)*prob(x4)*prob(x5)*prob(x6)*prob(x7);
  22. std::cout << 100 * res << " " << 7*(1/res - 1)/3;
  23. return 0;
  24. }
Success #stdin #stdout 0s 4368KB
stdin
Standard input is empty
stdout
75.6808 0.749792