- 计算邮资
key
- @ 2025-8-4 13:50:30
using namespace std;
int main() {
int weight;
char urgent;
cin >> weight >> urgent;
int total_cost = 8;
if (weight > 1000) {
int excess = weight - 1000;
int units = excess / 500;
if (excess % 500 != 0) {
units += 1;
}
total_cost += units * 4;
}
if (urgent == 'y') {
total_cost += 5;
}
cout << total_cost << endl;
return 0;
}
1 条评论
-
MVP (刘书赫) LV 7 @ 2025-8-4 15:07:15苏梓宁你个傻逼
- 1
信息
- ID
- 56
- 时间
- ms
- 内存
- MiB
- 难度
- 4
- 标签
- 递交数
- 151
- 已通过
- 68
- 上传者