雨霖处的悲哀
2015-02-01 13:54
#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;
}
厉害!
C语言入门
926027 学习 · 20793 问题
相似问题