#include <stdio.h>int pay(int cHour,float distance){ float paymoney; if(cHour>5 && cHour<=23){ if(distance<=3){ paymoney = 13 + 1; }else{ paymoney = 13 + (distance-3)*2.3 + 1; printf("%f\n",paymoney); } return paymoney; }else{ if(distance<=3){ paymoney = 13*1.2+1; }else{ paymoney = (13+(distance-3)*2.3)*1.2 + 1; } return paymoney; } }int main(){ float cmoney; cmoney = pay(9,12) + pay(6,12); printf("小明每天上班打的的费用为%f",cmoney); return 0;}这个我怎么结果是68呢?好像结果被取整了,可是类型没有定义错啊。
- 3 回答
- 0 关注
- 1470 浏览
添加回答
举报
0/150
提交
取消