题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
这里需要注意商家不是倒贴;最多免费。
int main() { int mon,day,cou; float price=0; scanf("%f %d %d %d",&price,&mon,&day,&cou); if(mon==11&&day==11) { if(cou==1) printf("%0.2lf",(0.7*price-50.00>=0?0.7*price-50.00:0)); else printf("%0.2lf\n",price*0.7); } else { if(mon==12&&day==12) { if(cou==1) { printf("%.2lf\n",(price*0.8-50>=0?price*0.8-50:0)); } else printf("%.2lf\n",price*0.8); } } return 0; }