题解 | #牛牛的快递#
https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
#include <stdio.h> int main( ) { double k,fee; char ch; scanf("%lf %c",&k,&ch); if(k<=1){ fee=20; if(ch=='y') fee+=5; } else{ if(k-(int)(k/1)>0){ fee=20+(int)(k-1)/1+1; } else{ fee=20+(k-1)/1; } if(ch=='y') fee+=5; } printf("%.0lf",fee); return 0; }