当前位置:网站首页>牛客小白月赛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;
}
边栏推荐
- 2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func
- 一文掌握数仓中auto analyze的使用
- 《工作、消费主义和新穷人》的微信读书笔记
- 整理混乱的头文件,我用include what you use
- Caché WebSocket
- 测试工程师如何“攻城”(上)
- Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
- 启牛开的证券账户安全吗?
- Rookie post station management system based on C language
- 26. 删除有序数组中的重复项 C#解答
猜你喜欢

Oracle with as ora-00903: invalid table name multi report error

PointNeXt:通过改进的模型训练和缩放策略审视PointNet++

建立自己的网站(15)

DeFi生态NFT流动性挖矿系统开发搭建

读写关闭的channel是啥后果?

OpenCV的二值化处理函数threshold()详解

物联网应用技术的就业前景和现状

神经网络物联网是什么意思通俗的解释

PolyFit软件介绍

The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
随机推荐
The page element is vertically and horizontally centered, realizing the vertical and horizontal centering of known or unknown width.
Leetcode fizzbuzz C # answer
Nebula Importer 数据导入实践
Rookie post station management system based on C language
Summary and sorting of 8 pits of redis distributed lock
神经网络物联网应用技术就业前景【欢迎补充】
DeFi生态NFT流动性挖矿系统开发搭建
《工作、消费主义和新穷人》的微信读书笔记
神经网络物联网平台搭建(物联网平台搭建实战教程)
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
Shell programming core technology "four"
神经网络物联网应用技术学什么
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
IBM WebSphere MQ检索邮件
如何使用Async-Awati异步任務處理代替BackgroundWorker?
repeat_P1002 [NOIP2002 普及组] 过河卒_dp
php伪原创api对接方法
页面元素垂直水平居中、实现已知或者未知宽度的垂直水平居中。
Process of manually encrypt the mass-producing firmware and programming ESP devices