题解 | #牛牛的快递#
牛牛的快递
https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
#include <stdio.h> int main() { float a;//快递重量 char b;//是否加急y/n int fee = 0, A; scanf("%f", &a); getchar(); b = getchar(); int d = (int)a; if (a == d) A = a; else A = a + 1; if (1 == A) { if (b == 'y') fee = 25; else fee = 20; } else { if (b == 'y') fee = 25 + (A - 1); else fee = 20 + (A - 1); } printf("%d", fee); return 0; }