#include <stdio.h>float fee(int t,int s){    float f;     if(s<=3)    {         f=13+1;    }     else    {       if((t<=23) && (t>5))        {            f=(s-3)*2.3+13+1;        }        else        {          f=(2.3*1.2)*(s-3)+13+1;        }    }   return f;}int main(){    printf("小明每天打车的总费用为:%.1f",(fee(9,12)+fee(18,12)));    return 0;}
                    
                    
                2 回答
 
                    
                    
                            Planeswalker23
                            
                                
                            
                        
                        
                                                
                    TA贡献6条经验 获得超1个赞
如果你的主函数是void main(){}的话,就不需要return了。而你现在是int main(){},所以需要返回一个值,这个值是0(也可以是任何int类型的变量)
- 2 回答
- 0 关注
- 1269 浏览
添加回答
举报
0/150
	提交
		取消
	
 
                    