#include <stdio.h>
int a(int c,int k )
{
int m;
if(k<=3.0)
{
m==14.0;
}
else
{
if(c>5 && c<=23)
{
m=14.0+(k-3)*2.3;
}
else
{
m=14.0+(k-3)*2.3*1.2;
}
}
return m;
}
int main()
{
printf("%f\n",a(9,12)+a(18,12));
return 0;
}
int换成float
#include <stdio.h>
int main()
{
int a,sum;
if(a>3)
{
sum=(a-3)*2.3+14;
printf("小明每天打车的总费用为:%d\n",sum);
}
return 0;
}
#include <stdio.h>
int main()
{
int a,sum;
if(a>3)
{
sum=(a-3)*2.3+14;
printf("小明每天打车的总费用为:%d\n",sum);
}
return 0;
}