题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h>
int main()
{
float price;
int moth, day, coupen;
while (scanf("%f %d %d %d", &price, &moth, &day, &coupen) != EOF)
{
if(moth == 11 && day == 11)
price = price*0.7 - 50*coupen;
else if(moth == 12 && day == 12)
price = price*0.8 - 50*coupen;
if(price <= 0)
price = 0;
printf("%.2f",price);
}
return 0;
}

查看3道真题和解析