#include <stdio.h>
float time(int x)
{
if(x>=23||x>=0&&x<=5)
{
float a=1.2;
return a;
}
else
{
int b=1;
return b;
}
}
float kilometre(float y)
{
int begin=13;
if(y>3)
{
float c=(y-3)*2.3+begin+1;
return c;
}
else
{
int d=begin+1;
return d;
}
}
int main()
{
float a,b,c,d;
a=9;
b=12;
c=6;
d=12;
float e=time(a)*kilometre(b)+time(c)*kilometre(d);
printf("小明每天打车的总费用是%f\n",e);
return 0;
}
傻圆傻圆
相关分类