题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h> int main() { int b, c, d; float a,price; while (scanf("%f %d %d %d", &a, &b, &c, &d) != EOF) { // 注意 while 处理多个 case // 64 位输出请用 printf("%lld") to if (b == 11 && c == 11) { if (1 == d) { price = a * 0.7 - 50; } else { price = a * 0.7; } } else { if (b == 12 && c == 12) { if (1 == d) price = a * 0.8 - 50; else price = a * 0.8; } else { price = a; } } if(price<0) price=0; printf("%.2f\n", price); } return 0; }