题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h>
int main()
{
double price;
int month;
int day;
int paper;
scanf("%lf %d %d %d", &price, &month, &day, &paper);
if (month == 11 && day ==11)
{
price *= 0.7;
}
else if((month == 12 && day ==12))
{
price *= 0.8;
}
if(paper == 1)
{
price -= 50;
}
if (price < 0)
{
printf("0.00\n");
}
else
printf("%.2lf", price);
return 0;
}
查看16道真题和解析