哪錯了求解答
#include <stdio.h>
float taxiFree(int clock,int mile)
{
? ??
? ? if (clock<23);
? ?{ cost=((mile-3)*2.3+13+1)*2;
? ? printf("%f\n",cost);
? ?}
? ? else
? ? {
? ? ? ? if(clock>=23||clock<5);
? ? ? {
? ? ? ? ? cost=((mile-3)*1.2*2.3+13+1);
? ? ? ? ? printf("%f\n",cost);
? ? ? ? }
? ? else(mile<=3)
? ? {
? ? ? ? cost==14;
? ? printf("%d\n",cost);
? ? ?}
? ? return cost;
}
? ??
}
int main()
{?
? ? float taxiFree(9,12)+taxiFree(18,12);
? ? printf("總費用\n",cost);
? ? return 0;
}
2018-10-12
1:少了cost的定義,你的float cost;呢????????? 2:else后面不能加(定義)吧????????????????????????????? 3:你的兩個函數(shù)相加應(yīng)該要來個字母什么的定義吧,比如int a=什么什么(那兩個函數(shù)相加)然后最后printf內(nèi)的“,”后應(yīng)該是上面那個字母吧