当前位置:网站首页>牛客小白月赛7 谁是神箭手
牛客小白月赛7 谁是神箭手
2022-07-04 17:58:00 【相思明月楼】
题目描述
有一天,MWH突然来了兴致,想和CSL比比谁枪法好。于是他们找来了一个瓶子,比比看谁先打中这个瓶子。 给定MWH的命中率和CSL的命中率
。 两人轮流射击,MWH先手,问谁获胜的概率大?
输入描述:
输入两个整数和,表示MWH和CSL的命中率。.
输出描述:
若MWH获胜的概率大,则输出"MWH"。 若CSL获胜的概率大,则输出"CSL",否则输出"equal"。
输入:
100 100
输出:
MWH
输入:
0 100
输出:
CSL
分别计算MWH和CSL(蔡盛梁)的获胜率,进行比较。
#include <iostream>
using namespace std;
int main() {
int a, b;
double pa, pb;
cin>>a>>b;
pa = 1.0*a/100;
pb = (1.0*(100-a)/100)*(1.0*b/100);
if(pa>pb) {
cout<<"MWH"<<endl;
} else if(pa<pb){
cout<<"CSL"<<endl;
} else {
cout<<"equal"<<endl;
}
return 0;
}
边栏推荐
- Detailed explanation of the binary processing function threshold() of opencv
- The 15th youth informatics competition in Shushan District in 2019
- 页面元素垂直水平居中、实现已知或者未知宽度的垂直水平居中。
- 如何使用Async-Awati异步任務處理代替BackgroundWorker?
- LeetCode第300场周赛(20220703)
- .NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)
- Oracle with as ora-00903: invalid table name multi report error
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- Rookie post station management system based on C language
- 测试工程师如何“攻城”(下)
猜你喜欢
A method of using tree LSTM reinforcement learning for connection sequence selection
一文掌握数仓中auto analyze的使用
如何使用Async-Awati异步任务处理代替BackgroundWorker?
奥迪AUDI EDI INVOIC发票报文详解
[release] a tool for testing WebService and database connection - dbtest v1.0
LM10丨余弦波动顺势网格策略
神经网络物联网应用技术学什么
How to use async Awati asynchronous task processing instead of backgroundworker?
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
物联网应用技术的就业前景和现状
随机推荐
物联网应用技术的就业前景和现状
建立自己的网站(15)
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
模板_大整数减法_无论大小关系
The kth largest element in the array
FPGA时序约束分享01_四大步骤简述
性能优化之关键渲染路径
26. 删除有序数组中的重复项 C#解答
Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
To sort out messy header files, I use include what you use
问下各位大佬有用过cdc直接mysql to clickhouse的么
Oracle with as ORA-00903: invalid table name 多表报错
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
.NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)
php伪原创api对接方法
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
The difference and usage between substr (), slice (), and substring () in the string interception methods of "understand series after reading"
如何使用Async-Awati异步任務處理代替BackgroundWorker?