求解一道高中信息技术会考编程题

2025-05-09 00:33:09
推荐回答(2个)
回答1:

#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;
}

具体问题追问吧

回答2:

太简单了,手机码不方便,明天电脑写