出租车费

来源:互联网 发布:北京万国数据员工待遇 编辑:程序博客网 时间:2024/06/08 12:32






#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){    double i , w;    scanf("%lf",&i);    i = ceil(i);    if(i <= 2){w=7;    }else if(i>2 && i<=15){w = 7 + (i - 2) * 1.5;    }else if(i>15){w = 7 + 13 * 1.5 + (i - 15) * 2.1;    }    printf("%.6lf", w);    return 0;}