- 题解
B1052计算邮资题解
- 2025-3-22 16:47:26 @
#include <iostream>
using namespace std;
int main() {
int weight;
char isUrgent;
cin >> weight >> isUrgent;
int baseFee = 8;
int extraFee = 0;
int urgentFee = 0;
if (weight > 1000) {
int extraWeight = weight - 1000;
extraFee = (extraWeight + 499) / 500 * 4;
}
if (isUrgent == 'y') {
urgentFee = 5;
}
int totalFee = baseFee + extraFee + urgentFee;
cout << totalFee << endl;
return 0;
}
0 条评论
目前还没有评论...