题解 | #网购#
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h> int main() { double val = 0.0; int month, day, Preferential = 0; scanf("%lf %d %d %d", &val, &month, &day, &Preferential); if (11 == month && 11 == day) { val = val * 0.7; if (Preferential == 1) val = val - 50; } if (12 == month && 12 == day) { val = val * 0.8; if (Preferential == 1) val = val - 50; } printf("%.2lf\n", val>0?val:0.0); return 0; }
商家不会找你钱翻译:优惠完不可能钱是负数
c语言刷题 文章被收录于专栏
c语言刷题题目