//阶梯电价
#include<stdio.h>
int main(int argc,char const *argv[])
{
double x,f;
printf("请输入月用电量:");
scanf("%lf",&x);
if(x<=50)
f=0.53*x;
else
f=0.53*50+0.58*(x-50);
printf("电费:%.2f\n",f);
return 0;
}
2-2 阶梯电价
最新推荐文章于 2023-12-20 17:01:30 发布