题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h>
int main() {
float a,price;
int b, c, d;
scanf("%f %d %d %d", &a, &b,&c,&d);
if(b==11)
{
price = a*0.7-50*d;
}
else if(b==12)
{
price = a*0.8-50*d;
}
if(price<0)//商家不可能倒找钱
{
price=0;
}
printf("%.2f\n", price);
return 0;
}
查看21道真题和解析