代码如下:
#include<stdio.h>
#include<stdlib.h>
double tpf(double prise)
{
double e;
int t;
t=prise*0.05*100;
if((t%100)<25)
{
t=t/100*100;
}
else if((t%100)>=25&&(t%100)<=75)
{
t=t/100*100+50;
}
else if((t%100)>75)
{
t=t/100*100+100;
}
e=t;
e=e/100;
return e;
}
int main()
{
double p;
scanf("%lf",&p);
printf("%.1lf",tpf(p));
return 0;
}