题解 | #网购#
网购
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 - discount*50; } else if (month == 12 && day == 12) { count = price*0.8 - discount*50; } if (count <= 0) { count = 0.0; } printf("%0.2lf", count); return 0; }