zzx_IT @ 2024-11-16 08:41:57
#include<bits/stdc++.h>
using namespace std;
int main(){
double kw,m;
cin>>kw;
if(kw<150)m+=0.4463*kw;
else{
m+=0.4463*150;
if(kw<400)m+=(kw-150)*0.4663;
else{
m+=(kw-400)*0.5663;
}
}
printf("%.1lf",m);
return 0;
}
by Twiter_ln @ 2024-11-16 08:46:00
答案很明显应该是
Input:
5
7 6 6 5 5
-->
Output:
3
Yours:
2
可以修改为:
6 6 6 6 6
5 6 6 7 7
3 4 4 5 5
但不存在只修改
by xuxingcheng @ 2024-11-18 21:12:28
代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
double x1=150*0.4463;
double x2=250*0.4663;
double n;
cin>>n;
if(n<=150){
printf("%.1lf",n*0.4463);
return 0;
}
if(n<=400){
n-=150;
printf("%.1lf",x1+n*0.4663);
return 0;
}
n-=400;
printf("%.1lf",x1+x2+n*0.5663);
return 0;
}