当前位置:网站首页>牛客小白月赛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;
}
边栏推荐
- 26. 删除有序数组中的重复项 C#解答
- 如何使用Async-Awati异步任务处理代替BackgroundWorker?
- 物联网应用技术的就业前景和现状
- Technologie de base de la programmation Shell IV
- node_exporter部署
- Send and receive IBM WebSphere MQ messages
- Pytest 可视化测试报告之 Allure
- Unity adds a function case similar to editor extension to its script, the use of ContextMenu
- Shell programming core technology "I"
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
猜你喜欢
小发猫物联网平台搭建与应用模型
YOLOv5s-ShuffleNetV2
OpenCV的二值化处理函数threshold()详解
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
读写关闭的channel是啥后果?
Hough Transform 霍夫变换原理
Detailed explanation of the binary processing function threshold() of opencv
自由小兵儿
升级智能开关,“零火版”、“单火”接线方式差异有多大?
随机推荐
Download the first Tencent technology open day course essence!
The 300th weekly match of leetcode (20220703)
In flinksql, in addition to data statistics, is the saved data itself a state
26. Delete the duplicate item C solution in the ordered array
SSL证书续费相关问题详解
Process of manually encrypt the mass-producing firmware and programming ESP devices
OpenCV的二值化处理函数threshold()详解
[uniapp] uniapp development app online Preview PDF file
2022养生展,健康展,北京大健康展,健康产业展11月举办
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
2022健康展,北京健博会,中国健康展,大健康展11月13日
关于判断点是否位于轮廓内的一点思考
在线文本行固定长度填充工具
Bi skills - permission axis
使用SSH
MySQL数据库基本操作-DDL | 黑马程序员
神经网络物联网应用技术学什么
Oracle with as ora-00903: invalid table name multi report error
Wechat reading notes of "work, consumerism and the new poor"