psn • 1年前
#include <cstdio>
#include <cmath>
using namespace std;
int main(void) {
double weight;
scanf("%lf", &weight);
weight = ceill(weight);
if (weight <= 20.0)
printf("%.2lf", weight * 1.68);
else
printf("%.2lf", 20.0 * 1.68 + (weight - 20.0) * 1.98);
return 0;
}
评论:
请先登录,才能进行评论