10491 - Cows and Cars Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1432 In television contests, participants are often asked to choose one from a set…
題目:有m+n個們,每個門後面有牛或者車:有n仅仅牛,m輛車,你選擇当中1個: 然後打開当中的k你沒有選中的門後是牛的,問你改變選時得到車的概率. 說明:數學題,概率.全概率公式就可以: 說明:第1001了O(∩_∩)O~ #include <stdio.h> int main() { int cow,car,show; while (~scanf("%d%d%d",&cow,&car,&show)) printf("%.5lf\n&quo…
UVA10491 - Cows and Cars(概率) 题目链接 题目大意:给你n个门后面藏着牛.m个门后面藏着车,然后再给你k个提示.在你作出选择后告诉你有多少个门后面是有牛的,如今问你作出决定后,依据提示改变你的选择可以成功的概率. 解题思路:简单的概率题,题目意思懂了应该没什么问题. 代码: #include <cstdio> #include <cstring> int main () { double n, m, k; while (scanf ("%lf%l…
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1432 #include <stdio.h> int main () { int a, b, c; ) { printf()) / (a + b - c - ) / (a + b )); } ; }…