mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-27 08:26:20 +00:00
10 lines
171 B
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;
|
|
}
|