为啥我输出小数后的数字是0?
#include <stdio.h>
char cost(li){ //li是里程
double pay; //花费
if(li<=3)
return 13;
else
pay=(li-3)*2.3+13+1;
return pay;
}
int main()
{
double pay=cost(12)*2;
printf("小明每天打车费用%f",pay);
return 0;
}
#include <stdio.h>
char cost(li){ //li是里程
double pay; //花费
if(li<=3)
return 13;
else
pay=(li-3)*2.3+13+1;
return pay;
}
int main()
{
double pay=cost(12)*2;
printf("小明每天打车费用%f",pay);
return 0;
}
2019-07-23
举报