酷代码 AI
菜单
服务商

用C++17找出战队投票中得票最高的路线编号

```cpp #include <iostream> #include <array> #include <algorithm> int main() { std::array<int, 5> voteCount = {0}; for (int i = 0; i < 6; ++i) { int route; std::cin >> route; voteCount[route - 1]++; } auto maxIt = std::max_element(voteCount.begin(), voteCount.end()); int maxRoute = std::distance(voteCount.begin(), maxIt) + 1; std::cout << maxRoute << std::endl; return 0; } ``` ######[AI问答 | 169点数解答 | 2026-02-14 19:24:29]

相关提问
发财导航,免费问AI
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]