救救孩子吧!太难了!
啊啊啊啊啊啊
#include <stdio.h>
double payment(int distance,int time)
{ double price;
if(distance<=3)
price=14;
else if(time>=0&&time<5||time>=23&&time<=24)
price=2.3*1.2*(distance-3)+14;
else
price=2.3*(distance-3)+14;
return price;
}
int main()
{
int L,T;
L=12;
T>=9&&T<=18;
double price=payment(L,T);
printf("小明每天打车总费用是%0.2f",price);
return 0;
}
//我这个可以运行
#include <stdio.h>double payment(int distance,int time){ double price; if(distance<=3) price=14; else if(time>=0&&time<5||time>=23&&time<=24) price=2.3*1.2*(distance-3)+14; else price=2.3*(distance-3)+14; return price;}int main(){ int L,T; L=12; T>=9&&T<=18; double price=payment(L,T); printf("小明每天打车总费用是%0.2f",price); return 0;}
举报