拿走不谢
2025-09-07 20:36:53
发布于:山东
2阅读
0回复
0点赞
#include <iostream>
#include <iomanip> // 用于设置输出精度
using namespace std;
int main() {
int n;
cin >> n; // 读取短信发送次数
int total_sms = 0; // 统计总短信条数
for (int i = 0; i < n; ++i) {
int x;
cin >> x; // 读取每次短信的字数
// 计算当前短信需分割的条数(向上取整)
total_sms += (x + 69) / 70;
}
double cost = total_sms * 0.1; // 计算总资费
// 输出总资费,精确到小数点后1位
cout << fixed << setprecision(1) << cost << endl;
return 0;
}
这里空空如也
有帮助,赞一个