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