请问一下这样行不行?
#include <stdio.h>
float dache(int x,int y)
{float money;
if(y<=3){
money=14;
}else if(5<x<=23&&y>3){
money=14+2.3*(y-3);
}else{
money=14+2.3*1.2*(y-3);
}
return money;
}
int main()
{
float zmoney;
zmoney=dache(9,12)+dache(18,12);
printf("小明每天打车的总费用为%.1f",zmoney);
return 0;
}