#include
int main(){
double con,fee;
printf("please input the consumption:\n");
scanf("%lf",&con);
if(con<=2880) fee=con*0.48;
else if(con<=4800 && con>2880) fee=2880*0.48+(con-2880)*0.53;
else if(con>4800) fee=2880*0.48+(4800-2880)*0.53+(con-4800)*0.78;
printf("the cost is:%.2lf",fee);
return 0;
}
具体问题追问吧
太简单了,手机码不方便,明天电脑写