錯(cuò)在哪里?。?/h1>
#include <stdio.h>
double Price(int Time,float mile)
{
? ? double pay;
? ? if(mile<=3)
? ? {
pay=13;
? ? }
? ? else
? ? {
? ? ? ? if (Time<=23&&Time>=5)
? ? ? ? {
pay+=(mile-3)*2.3;
? ? ? ? }
? ? ? ? else
{
pay+=(mile-3)*2.3*1.2;
}
? }
pay+=1;
return pay;
}
int main()
{
? ? double total;
total=Price(9,12)+Price(18,12);
printf("花費(fèi)%lf元",total);
? ? return 0;
}
#include <stdio.h>
double Price(int Time,float mile)
{
? ? double pay;
? ? if(mile<=3)
? ? {
pay=13;
? ? }
? ? else
? ? {
? ? ? ? if (Time<=23&&Time>=5)
? ? ? ? {
pay+=(mile-3)*2.3;
? ? ? ? }
? ? ? ? else
{
pay+=(mile-3)*2.3*1.2;
}
? }
pay+=1;
return pay;
}
int main()
{
? ? double total;
total=Price(9,12)+Price(18,12);
printf("花費(fèi)%lf元",total);
? ? return 0;
}
2017-08-30
格式要對