洛谷:P1422 小玉家的电费
作者:互联网
1、
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
double s;
scanf("%d",&n);
if(n<=150) s=n*0.4463;
else if(n<=400&&n>=151) s=150*0.4463+(n-150)*0.4663;
else if(n>=401) s=150*0.4463+250*0.4663+(n-400)*0.5663;
printf("%.1lf",s);
return 0;
}
标签:151,150,洛谷,int,0.4463,P1422,0.4663,小玉家,include 来源: https://blog.csdn.net/qq_50917103/article/details/121058147