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