#include int main() { float pLoseW,pLoseB; float p; float beta; int yourrating,theirrating; printf("Please input Playing as White (Lose) e.g. 89.33 :"); scanf("%f", &pLoseW); printf("Please input Playing as Black (Lose) e.g. 89.93 :"); scanf("%f",&pLoseB); printf("Please input Your rating: e.g. 25: "); scanf("%d", &yourrating); printf("Please input Their rating: e.g. 26: "); scanf("%d",&theirrating); pLoseW = pLoseW * 0.01; pLoseB = pLoseB * 0.01; p = abs(pLoseW - 0.5) > abs(pLoseB-0.5) ? pLoseB : pLoseW; if (p < 0.5) beta = (log(p) - log(0.5)) / (2*log(0.75)); else beta = (log(0.5) - log(1-p)) / (2*log(0.75)); printf("Beta is %f. Therefore the difference are about %f games. \n", beta, beta/ 0.045); printf("Your actual rating maybe: %f\n", abs(pLoseW - 0.5) > abs(pLoseB-0.5) ? yourrating - beta : theirrating + beta); exit(0); }