#include <stdio.h>
int f(int time,int distance)
{
double money;
if(time>=5&&time <=23)
if(distance<=3)
money=13;
else
money=13+2.3*(distance-3);
else
if(distance<=3)
money=14;
else
money=14+2.3*1.2*(distance-3);
return money;
}
int main()
{
int a,distances=12, time1=9,time2=18,b;
a=f(time1,distances);
printf("上班的车费是:%d\n",&a);
b=f(time2,distances);
printf("下班的车费是:%d\n",&b);
return 0;
}
望远
qq_梦里_0