為什么不行呢
#include <stdio.h>
double taxi_price(int n,int time)
{
? ? double price;
? ? if(time >= 23 || time >= 0 && time <= 5 )
? ? {
? ? ? ? printf("price=%f",n<=3 ? price=13+1+n*(1+0.2)*2.3 : price=n*2.3*(1+0.2)+1);
? ? }
? ? else
? ? {
? ? ? ? printf("price=%f",n<=3 ? price=13+1 : price=n*2.3+1);
? ? }
}
int main()
{
? ? printf("price=%f",price=taxi_price(12,9)+taxi_price(12,21));
? ? return 0;
}
2018-07-15