题解 | 网购
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h> int main() { float price; int month; int date; int a; scanf("%f %d %d %d",&price,&month,&date,&a); if(month == 11 && date == 11 ){ if(a == 1){ if(price * 7.0 / 10.0 >= 50.0){ printf("%.2f",price * 7.0 / 10.0 - 50.0); }else{ printf("0.00"); } }else if(a == 0){ printf("%.2f",price* 7.0 / 10.0); } }else if(month == 12 && date == 12){ if(a == 1){ if(price * 8.0 / 10.0 >= 50.0){ printf("%.2f",price * 8.0 / 10.0 - 50.0); }else{ printf("0.00"); } }else if(a == 0){ printf("%.2f",price * 8.0 / 10.0); } }else{ printf("%.2f",price); } return 0; }