80分求助

P1422 小玉家的电费

florrcspj @ 2023-11-17 21:11:47

#include<bits/stdc++.h>
using namespace std;
int a;
double b;
int main()
{
    cin>>a;
    if(a<=150) b=a;
    if(a>150 && a<=400) b=(150* 0.4463)+(a-150)*0.4663;
    if(a>400) b=(150*0.4463)+(a-150-(a-400))*0.4663+(a-400)*0.5663;
    printf("%.1f\n",b);
    return 0;
}

by sunshinelong @ 2023-11-19 19:01:02

我也是80,无语


by florrcspj @ 2023-11-23 13:49:43

@sunshinelong 6


by hjsxzz2022 @ 2023-12-12 09:18:38

if(a<=150) b=a; 这行有问题,应改成b=a*0.4463


by jiangyichen_10 @ 2024-07-05 15:08:49

无语树上无语果,无语树下你和我。(我也是80)


|