C语言编程结果输出一直是0应该怎么办
源代码如下:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char car;
long int startingtimehour,startingtimeminute,endingtimehour,endingtimeminute,thetime;
double money;
printf("请输入车辆类型(C代表轿车,B代表客车,T代表卡车)");
car=getchar();
printf("入库:xx时xx分,出库:xx时xx分(请输入对应的数字)");
scanf("四个%ld(因为社区不让输入重复的符号所以只能这样写了)",&startingtimehour,&startingtimeminute,&endingtimehour,&endingtimeminute);
if (endingtimehour=startingtimehour)
{thetime=(endingtimehour-startingtimehour)+(endingtimeminute-startingtimeminute)/60;}
else if (endingtimehour>startingtimehour&&endingtimeminute<=startingtimeminute)
{ if (endingtimehour-startingtimehour==1)
{thetime=(60-(startingtimeminute-endingtimeminute))/60;}
else
{
thetime=(endingtimehour-startingtimehour-1)+(60-(startingtimeminute-endingtimeminute))/60;
}
}
else if(endingtimehour>startingtimehour&&endingtimeminute>startingtimeminute)
{
thetime=(endingtimehour-startingtimehour)+(endingtimeminute-startingtimeminute)/60;
}
else if(endingtimehour<startingtimehour&&endingtimeminute>=startingtimeminute)
{
thetime=(24+endingtimehour-startingtimehour)+(endingtimeminute-startingtimeminute)/60;
}
else
{
if(24+endingtimehour-startingtimehour==1)
{
thetime=(60-(startingtimeminute-endingtimeminute))/60;
}
else
{thetime=(24+endingtimehour-startingtimehour-1)+(60-(startingtimeminute-endingtimeminute))/60;
}
}
switch(car){
case'C':switch(thetime/3){
case 0:money=5*thetime;
c=double money
printf("应交%d元\n",money);break;
case !0:money=5*3+10*(thetime-3);
printf("应交%d元\n",money);break; };break;
case'B':switch(thetime/2){
case 0:money=10*thetime;
printf("应交%d元\n",money);break;
case !0:money=20+15*(thetime-2);
printf("应交%d元\n",money);break;};break;
case'T':switch(thetime/1){
case 0:money=10*thetime;
printf("应交%d元\n",money);break;
case !0:money=10+(thetime-1)*15;
printf("应交%d元\n",money);break;};break;
}
}
这个程序是算三种车的停车费用:输入的是车辆类型和入库出库时间,每一种车辆不同的时间范围内的每小时的收费不一样,输出应交的停车费
最后算停车费结果显示是0
希望有人能指点一下