#include <stdio.h>extern void printLine() //这里定义的方法对吗?{ printf("**************\n"); }int main(){ void say(){ printLine(); printf("I love imooc\n"); printf("good good study!\n"); printf("day day up!\n"); printLine();} say(); return 0;}
#include <stdio.h>
float taxifee(int clock,int miles)
{
float money;
if(miles<=3)
{
money=14;
printf("费用为14\n");
}
else
{
if(clock>=23 || clock<5)
{
money=13+1+2.3*(miles-3)*1.2;
printf("夜间车费为:%f\n",money);
}
else
{
money=13+1+2.3*(miles-3);
printf("日间车费为:%f\n",money);
}
}
return money;
}
int main()
{
printf("打的总费用:%.1f\n",taxifee(9,12)+taxifee(18,12));
return 0;
}