UVA10491 - Cows and Cars(概率)
来源:互联网 发布:支持windows的手机 编辑:程序博客网 时间:2024/06/16 08:05
UVA10491 - Cows and Cars(概率)
题目链接
题目大意:给你n个门后面藏着牛,m个门后面藏着车,然后再给你k个提示,在你作出选择后告诉你有多少个门后面是有牛的,现在问你作出决定后,根据提示改变你的选择能够成功的概率。
解题思路:简单的概率题,题目意思懂了应该没什么问题。
代码:
#include <cstdio>#include <cstring>int main () { double n, m, k; while (scanf ("%lf%lf%lf", &n, &m, &k) != EOF) { double tmp1 = m + n; double tmp2 = (m + n - k - 1.0); double ans = n /tmp1 * (m / tmp2) + m /tmp1 * ((m - 1)/tmp2); printf ("%.5lf\n", ans); } return 0;}
0 0
- UVA10491 - Cows and Cars(概率)
- UVa10491 - Cows and Cars(概率)
- 【全概率公式】Cows and Cars, UVa10491
- Uva10491 cows and cars
- uva10491 Cows and Cars
- uva10491 - Cows and Cars(牛和车)
- uva 10491 - Cows and Cars(概率)
- 10491 - Cows and Cars (概率)
- UVA 10491 Cows and Cars(概率)
- UVa 10491 - Cows and Cars(概率)
- UVa 10491 Cows and Cars(概率计算)
- UVa 10491 - Cows and Cars 概率
- UVA 10491 Cows and Cars 概率
- UVA - 10491 Cows and Cars 概率
- UVA 10491 Cows and Cars(全概率)
- UVA.10491 Cows and Cars (概率)
- 例题10-10 UVA - 10491 Cows and Cars 奶牛与轿车 (全概率)
- UVa 10491 Cows and Cars (概率&广义三门问题 )
- struts2+Spring + hibernate 中对action的单元测试环境搭建
- 用 Lotus Domino Designer 8.5.1 创建 Java 代理
- Oralce深究
- java treeMap 使用
- 利用mahout自带的fpgrowth程序以及自己的原始数据挖掘频繁模式
- UVA10491 - Cows and Cars(概率)
- Project : error PRJ0019: 工具从"正在执行生成后事件..."
- Android 4.4 SystemUi分析
- 如何发挥网站内链的作用
- hibernate指定属性不映射到数据库里
- c#中Convert.ChangeType的意义
- 13-C语言总结
- MyEclipse不编译
- freopen