题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h> int main() { int b, c, d; double a, goal; while (scanf("%lf %d %d %d", &a, &b, &c, &d) != EOF) { if (b == 12 && c == 12) { goal = a * 0.8; if (d == 1) { goal -= 50; } } if (b == 11 && c == 11) { goal = a * 0.7; if (d == 1) { goal -= 50; } if(goal<=0) { goal=0; } } printf("%.2f", goal); } return 0; }