UVa 11346 - Probability
生活随笔
收集整理的這篇文章主要介紹了
UVa 11346 - Probability
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
純粹數(shù)學題,推公式吧。注意邊界處理精度控制就可以了。
#include <cstdio> #include <cmath> #define EPS 1e-7 int main() {int T; scanf("%d", &T);while (T--){double a, b, S; scanf("%lf %lf %lf", &a, &b, &S);if (S - a *b >= EPS) puts("0.000000%");else if (S <= EPS) puts("100.000000%");else printf("%f%%\n", (a *b - S - S * log(a * b / S)) / (a * b) * 100);}return 0; }
轉載于:https://www.cnblogs.com/kunsoft/p/5312693.html
總結
以上是生活随笔為你收集整理的UVa 11346 - Probability的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于visual studio类视图和资
- 下一篇: 随机给出三十道四则运算题目