St义
2016-01-17 17:04
#include <stdio.h>
int main()
int Kilo,Money,Time,Per;
int Counting(int a , int b)
{
a = Kilo; b = Time;
if(Time>23||Time<<5)
{
Per = 4.3;
}
else Per =2.3;
if(Kilo<3)
{
Money = 13;
}
else Money = (Kilo - 3) *Per +13;
return Money;
}
{
Printf("小明每天打车费用为:%d",Counting(12,,9)+Couting(12,6)
return 0;
}
至少少了个括号
#include <stdio.h> int Kilo,Money,Time,Per; int Counting(int time , int distance) { Kilo = distance; Time = time; if(Time>23||Time<<5) { Per = 4.3; if(Kilo<=3) { Money = 13; } else { Money = (Kilo - 3) * Per +13; } } else { Per =2.3; if(Kilo<=3) { Money = 13; } else { Money = (Kilo - 3) * Per +13; } } return Money; } int main(){ printf("小明每天打车费用为:%d\n",Counting(3,13)); return 0; }
你写的有好几处语法错误,自己再好好看看前面的基础知识
C语言入门
926209 学习 · 20797 问题
相似问题