20分求助!!!#1 #2 #4 #5

P1422 小玉家的电费

levy3304 @ 2023-08-21 12:03:12

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

by BLACK_MANBA @ 2023-08-21 12:05:34

double


by BLACK_MANBA @ 2023-08-21 12:06:40

@levy2011


by levy3304 @ 2023-08-22 10:03:55

过了,谢谢


|