题解 | 网购
#include <stdio.h> int main() { float money, val; int arr[3] = {0}; scanf("%f", &money); for (int i = 0; i < 3; i++) { scanf("%d", &arr[i]); } if (arr[0] == 11) { if (arr[2] == 1) { val = money * 0.7 - 50; } else { val = money * 0.7; } } else { if (arr[2] == 1) { val = money * 0.8 - 50; } else { val = money * 0.8; } } if (val < 0)val = 0; printf("%.2f", val); return 0; }