want_AC_ing @ 2023-04-12 17:32:05
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
float a;
scanf("%d",&n);
if(n<=150){a=150*0.4463;}
else if((n <=400)&&(n>=151)){a=150*0.4463+(n-150)*0.4663;}
else if(n>400){a=150*0.4463+250*0.4663+(n-400)*0.5663;}
printf("%.1f",(int)(a*10+0.5)/10.0);
return 0;
}
by CCC100 @ 2023-04-12 18:31:24
第9行,您可以改成a=n*0.4463
,可以AC
by want_AC_ing @ 2023-04-12 23:52:35
@CCC100 谢谢了,没仔细看