劳烦各位大佬给看看这个程序哪里出问题了?
#include<stdio.h>
int normal(int time1,int time2,int n)
{
float money=0,money1=0,money2=0;
if(n<=3)
money=13;
else money=(n-3)*2.3+13;
printf("money=%d\n",money);
if(time1>=5&&time1<=23)
money1=money+1;
else money1=1.2*money+1;
if(time2>=5&&time2<=23)
money2=money+1;
else money2=1.2*money+1;
printf("money=%d,%d\n",money1,money2);
money=money1+money2;
return money;
}
main()
{
int time1,time2,n;
time1=9;
time2=18;
n=12;
printf("money is %f", normal(time1,time2,n));
}
money的值总是不正常。