我这个看起来好复杂的样子
#include <stdio.h>
double feiyong;
double danjia;
double fei(double x,double y)
{
if (x>=3)
feiyong=13+(x-3)*y+1;
else
feiyong=13+1;
return 0;
}
double dan(double x)
{
if(x>=23||x<=5)
danjia=1.2*2.3;
else
danjia=2.3;
return 0;
}
main()
{
double juli=12;
double shangban=9;
double xiaban=6;
dan(shangban);
fei(juli,danjia);
double feiyongs=feiyong;
dan(xiaban);
fei(juli,danjia);
double feiyongx=feiyong;
double zonfeiyong=feiyongs+feiyongx;
printf("小明每天打车的总费用为:%f。\n",zonfeiyong);
return 0;
}