c语言用if else语句判断怎么到第二句就停了?

#include
#include
#include
int main()
{
int charge,weight;
cx:printf("请输入货物重量\n");
scanf("%d", &weight);
if (weight<=15) charge=0;
else if(15<weight<=25) charge=(weight-15)*12;//全是用这条进行计算了
else if(25<weight<=45) charge=(weight-25)*15+(25-15)*12;//输入26其实要135元但最后输出才132元
else if(45<weight<=80) charge=(weight-45)*20+(45-25)*15+(25-15)*12;//输入46其实要440元但最后输出才372
else charge=(weight-80)*30+(80-45)*20+(45-25)*15+(25-15)*12;//输入81其实要1025但最后才输出792
printf("%s%d%s","货物重量:",weight,"\n");
printf("%s%d%s","货物运费:",charge,"\n");
sleep(5);
system("cls");
goto cx;
}


不能直接写成

15<weight<=25

要写

 weight > 15 && weight <= 25

下面几个类同

编程的条件语句不能写成数学那种连续格式,要分开写。不然计算机无法识别