Run ID:141470

提交时间:2025-12-25 14:23:36

#include <iostream> #include <iomanip> // 用于控制输出格式 using namespace std; int main() { double total = 0.0; // 用于累加总工资 double salary; // 临时存储每月工资 // 读取12个月的工资 for (int i = 0; i < 12; i++) { cin >> salary; total += salary; // 累加到总和 } // 计算平均工资 double average = total / 12; // 输出结果,保留两位小数,前面加上¥符号 cout << "¥" << fixed << setprecision(2) << average << endl; return 0; }