#include <stdio.h> double price(double ditance,double period) { double Price; if(ditance<3) { double Price=13; } else if(period<23||period>5) { double Price=13+(ditance-3)*2.3; } else { double Price=13+(ditance-3)*2.3*1.2; } return Price; } int main() { //double price0; double price1; //double price2; //double ditance1; //double period1; //double period2; //scanf("%d,%d,%d",&ditance,&period1,&period2); price1=price(12,9); // price2=price(12,18); //price0=price1+price2; printf("小明每天打车的总费用为%lf\n",price1); return 0; }
Yexiaomo
相关分类