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