Run ID:141467

提交时间:2025-12-25 11:38:52

#include <iostream> using namespace std; int main() { int red; // 红球数量 cin >> red; int colors[6]; // 黄、绿、棕、蓝、粉、黑的数量 int scores[6] = {2, 3, 4, 5, 6, 7}; // 对应分值 for (int i = 0; i < 6; i++) { cin >> colors[i]; } // 找出有球的彩球中的最高分值 int maxScore = 0; for (int i = 0; i < 6; i++) { if (colors[i] > 0 && scores[i] > maxScore) { maxScore = scores[i]; } } // 阶段1:有红球时 int phase1 = red * (1 + maxScore); // 阶段2:按顺序清彩球 int phase2 = 0; for (int i = 0; i < 6; i++) { phase2 += colors[i] * scores[i]; } // 总分 int total = phase1 + phase2; cout << total << endl; return 0; }