当前位置:网站首页>L1-051 打折 (5 分)
L1-051 打折 (5 分)
2022-04-21 10:00:00 【WTXYL】
去商场淘打折商品时,计算打折以后的价钱是件颇费脑子的事情。例如原价 ¥988,标明打 7 折,则折扣价应该是 ¥988 x 70% = ¥691.60。本题就请你写个程序替客户计算折扣价。
输入格式:
输入在一行中给出商品的原价(不超过1万元的正整数)和折扣(为[1, 9]区间内的整数),其间以空格分隔。
输出格式:
在一行中输出商品的折扣价,保留小数点后 2 位。
样例:
输入样例:
988 7
输出样例:
691.60
代码:
#include <cstdio>
int main(){
int a, b;
scanf("%d %d", &a, &b);
printf("%0.2f", a * b * 1.0 / 10);
}
版权声明
本文为[WTXYL]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46891900/article/details/124217119
边栏推荐
猜你喜欢

【手拉手 带你准备电赛】April Tag标记跟踪(3D定位)详解

金融零售图谱-交易流水预警图谱

ArUco与OpenCV

Grid layout -- grid
![[notes] Launch file syntax record](/img/68/cbd3d6173535223c54e1dcf9ecc142.png)
[notes] Launch file syntax record

Common text processing commands

SAP导出物料库存量代码

常用文本处理命令
![[summary] 1296 - summarize 12 common mobile terminal H5 and hybrid development problems](/img/4d/c3216ead34b286bae58c030c3c4c00.jpg)
[summary] 1296 - summarize 12 common mobile terminal H5 and hybrid development problems
![[daily question 1] stone jumping -- dynamic programming](/img/c2/ae0cd99aedf41a62a41d07591d9a55.png)
[daily question 1] stone jumping -- dynamic programming
随机推荐
[fluent topic] 124 summary of daily problems (III) two or three things about custom dialog
C#入门-并行编程
字符串匹配 KMP BF
【并发编程044】CAS循环时间太长,会有什么问题?
2022 a special equipment related management (elevator) test question simulation test platform operation
2022危险化学品经营单位主要负责人上岗证题库及模拟考试
网站被挂博彩暗链
Shell变量$#,$@,$0,$1,$2,${},##,%%使用解释以及好用的shell格式化工具
利用pycharm在Pyside2中加载qrc资源文件
【愚公系列】2022年04月 微信小程序-项目篇(公交查询)-01周边站点
[pycharm plugins] download online to install the translation plug-in
VR panorama is suitable for those industries
Transaction isolation level and mvcc
CommDGI: Community detection oriented deep graph infomax 2020 CIKM
Promise handles complex asynchrony
【愚公系列】2022年04月 微信小程序-地图的使用之线聚合
Cisco Packet Tracer实验集合
2022 refrigeration and air conditioning equipment operation test question simulation test question bank and answers
About incorrect deletion of operations in notes
Cilcate环境搭建