#include<stdio.h>
int main() {
double cost, n;
scanf("%lf", &n);
if(n<0) {
printf("Invalid Value!\n");
} else if(n<=50) {
cost = n*0.53;
printf("cost = %.2f\n", cost);
} else {
cost = 50*0.53+(n-50)*(0.53+0.05);
printf("cost = %.2f\n", cost);
}
return 0;
}
标签:lf,int,电价,阶梯,习题,include From: https://www.cnblogs.com/ytmsnzy/p/16587870.html