题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
注意,浮点数最好与浮点数进行运算
#include <stdio.h> int main() { double val; int month,day,youhui; scanf("%lf%d%d%d%d",&val,&month,&day,&youhui); if(month==11&&day==11) { val*=0.7; if(youhui==1) { val-=50.0; } }else if(month==12&&day==12) { val*=0.8; if(youhui==1) { val-=50.0; } } if(val<=0) { val=0.0; } printf("%.2lf",val); return 0; }