1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课内】12.函数3/6-3 累计销售.c

10 lines
171 B
C

double price(double x) {
static double sum = 0;
sum += x;
if (sum < 5000) return sum * 0.01;
if (sum < 10000) return sum * 0.05;
return sum * 0.1;
}