呜呜呜 孩子这个哪里错了,有人能找出来不
运行后提示getCost()方法里面报错
运行后提示getCost()方法里面报错
2020-02-18
#include <stdio.h>float sum,lai,hui,cost;float getCost(int m,int n){ if(m>=5&&m<=23){ if(n<=3){ cost=13+1; }else{ cost=13+(n-3)*2.3+1; } }else{ if(n<=3){ cost=13+1; }else{ cost=13+(n-3)*2.3*1.2+1; } } return cost;}int main(){ lai = getCost(9,12); hui = getCost(18,12); sum = lai+hui; printf("cost is %f",sum); return 0;}
举报