怎么運行不了 請問大神 哪里錯了
#include <stdio.h>
int mtc(int a,int b)//a為公里數 b為打車時間
{
? ? int c;//打車總費用
? ? if(a<=3)
? ? {
? ? ? ? c=14;
? ? ? ? printf("總公里數小于等于三公里的費用為:%d\n",c);
? ? }
? ? else
? ? ? ? if(b>=23||b<5)
? ? ? ? {
? ? ? ? ? ? c=14+14*0.2+(a-3)*2.3*0.2+(a-3)*2.3;
? ? ? ? ? ? printf("夜間打車費用為:%f\n",c);
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? c=14+2.3*a;
? ? ? ? ? ? printf("白天打車費用為:%f\n",c);
? ? ? ? }
? ? ? ? return c;
}
int main()
{
? ? printf("小明每天打車的總費用:%f\n",mtc(12,9)+mtc(12,6));
? ? return 0;
}
2019-02-10
mtc()函數返回值應該為浮點型