L1-051. 打折
时间限制
400 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
作者
陈越
去商场淘打折商品时,计算打折以后的价钱是件颇费脑子的事情。例如原价 ¥988,标明打 7 折,则折扣价应该是 ¥988 x 70% = ¥691.60。本题就请你写个程序替客户计算折扣价。
输入格式:
输入在一行中给出商品的原价(不超过1万元的正整数)和折扣(为[1, 9]区间内的整数),其间以空格分隔。
输出格式:
在一行中输出商品的折扣价,保留小数点后 2 位。
输入样例:988 7输出样例:
691.60
#include <iostream>
#include <vector>
using namespace std;
int main() {
//freopen("1.txt", "r", stdin);
double price, discount;
cin >> price >> discount;
price *= 100;
price = price * discount / 1000;
printf("%.02lf", price);
return 0;
}