记录一下记录一下
#include <stdio.h>
float price(float distence,int come,int back )
{
float price_come,price_back,price_base;
price_base=13+(distence-3)*2.3+1;
if(come>=5)
price_come=price_base;
else
price_come=1.2*price_base;
if(back<23)
price_back=price_base;
else
price_back=1.2*price_base;
return price_come+price_back;
}
int main()
{
printf("小明每天打车的费用为%f",price(12,9,6));
return 0;
}