当前位置:网站首页>牛客小白月赛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;
}
边栏推荐
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- 如何使用Async-Awati异步任务处理代替BackgroundWorker?
- LeetCode 赎金信 C#解答
- 使用SSH
- 从实时应用角度谈通信总线仲裁机制和网络流控
- Pointnet/Pointnet++点云数据集处理并训练
- . Net ORM framework hisql practice - Chapter 2 - using hisql to realize menu management (add, delete, modify and check)
- 长城证券开户安全吗 买股票怎么开户
- Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
- Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
猜你喜欢

The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
关于判断点是否位于轮廓内的一点思考

Pointnet/Pointnet++点云数据集处理并训练

Pytorch学习(四)

Stream流

大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行

A method of using tree LSTM reinforcement learning for connection sequence selection

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

神经网络物联网平台搭建(物联网平台搭建实战教程)

Wireshark网络抓包
随机推荐
Rookie post station management system based on C language
Send and receive IBM WebSphere MQ messages
Opencv functions and methods related to binary threshold processing are summarized for comparison and use
876. 链表的中间结点
2022养生展,健康展,北京大健康展,健康产业展11月举办
神经网络物联网应用技术学什么
Download the first Tencent technology open day course essence!
小发猫物联网平台搭建与应用模型
信息学奥赛一本通 1336:【例3-1】找树根和孩子
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
利用策略模式优化if代码【策略模式】
2021 Hefei informatics competition primary school group
Lex and yacc based lexical analyzer + parser
在线文本行固定长度填充工具
Nebula Importer 数据导入实践
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
偏移量函数及开窗函数
FTP, SFTP file transfer
Have you guys ever used CDC direct Mysql to Clickhouse
Perfect JS event delegation