請問我這哪里錯了,提示expected declaration or statement at end of input
#include <stdio.h>
float asd(int z,int s)
{
? ? float y;
? ? if(s<=3)
? ? {
? ? ? ? y=14;
? ? ? ? printf("小明每天打車費用為:14元");
? ? }?
? ? else
? ? {
? ? ? ? if(z>=5&&z<23)
? ? ? ? {
? ? ? ? y=14+(s-3)*2.3;
? ? ? ??
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? y=14+(s-3)*1.2*2.3;
? ? ? ??
? ? ? ? }
? ? return y;
}
int main()
{
? ? printf("小明打車的總費用是%f元\n",asd(9,12)+asd(18,12));
? ? return 0;
}
2018-03-27
int main前面少了個{
if(s<=3)
? ? {
? ? ? ? y=14;
? ? ? ? printf("小明每天打車費用為:14元");
? ? }?
改成
if(s<=3)
? ? {
? ? ? ? return 14;
? ? }?