- 计算邮资
key
- @ 2025-7-18 15:48:02
`c++ #include <bits/stdc++.h> 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; }
0 条评论
目前还没有评论...
信息
- ID
- 56
- 时间
- ms
- 内存
- MiB
- 难度
- 4
- 标签
- 递交数
- 151
- 已通过
- 68
- 上传者