#include <stdio.h>
double addmoney(int time,int decent)
{
double money;
if(decent<=3)
return 14;
else if(time>=5&&time<23)
{
money=(decent-3)*2.3+14;
}
else
money=(decent-3)*2.3*1.2+14;
return money;
}
int main()
{
double z;
z=addmoney(9,12)+addmoney(18,12);
printf("小明每天打车的费用为%lf",z);
return 0;
}
我这个为什么不行啊
#include <stdio.h>
int jifei(int i,int t)
{
int i;
int t,sum;
if(t>=23&&<=24||t<5&&t>0)
{
if(i<=3)
{
sum=13;
}
else
{
sum=13+(i-3)*1.2*2.3+1;
}
printf("%d",sum);
return sum;
}
else
{
if(i<=3)
{
sum=13;
}
else
{
sum=13+2.3*(i-3)+1;
}
}
printf("%d",sum);
return sum;
}
int main{
int z;
z=jifei(12,9)+jifei(12,6);
printf("%d",z) ;
}