题解 | #牛牛的快递#
牛牛的快递
https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
#include <stdio.h> int main() { // 快递重量 float a = 0.0f; // 表示是否选择加急 char b = 0; while (2 == scanf("%f %c", &a, &b)) { printf("%.0f\n", ('y' == b ? 5 : 0) + (a <= 1 ? 20.0 : (20.0 + ((int)(a - 1) - (a - 1) == 0 ?(a - 1) : (int)(a - 1) + 1)))); } return 0; }