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