求解
每一行与图照应
#include<stdio.h>
int main()
{
int w;
double s;
scanf("%d",&w);
if(w>0&&w<5)
s=3;
else if(w>5&&w<=10)
s=3+3.5*(w-5);
else if(w>10&&w<=20)
s=20.5+(w-10)*4;
else if(w>20&&w<=30)
s=60.5+(w-20)*4.5;
else if(w>30&&w<=50)
s=105.5+(w-30)*5;
else if(w>50)
error;
printf("%d",w);
return 0;
}