题解 | #牛牛的快递#
牛牛的快递
https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
#include<iostream> #include<iomanip> using namespace std; int main() { float weight; int weight1,price,extraprice; char cha; cin>>weight>>cha; weight1=weight; if(cha=='y') { if(weight!=weight1&&weight>0) { cout<<int(weight1)+25; } else cout<<int(weight1-1)+25; } if(cha=='n') { if(weight!=weight1&&weight>0) { cout<<int(weight1)+20; } else cout<<int(weight1-1)+20; } return 0; }