题解 | #牛牛的快递#
牛牛的快递
https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
#include <stdio.h> int main() { float a; char b; int amount = 0; scanf("%f %c",&a,&b); if(a <= 1){ if(b == 'y'){ amount = 25; } else { amount = 20; } } else{ int c = a-0.1 + 1; // 向上取整 if(b == 'y'){ amount = c + 20 + 4; } else { amount = c + 19; } } printf("%d",amount); return 0; }