酷代码 AI
菜单
服务商

C++实现依据奥兹玛之心数字信号确定前进方向与总路程

```cpp #include <iostream> using namespace std; int main() { int n; cin >> n; int totalDistance = 0; for (int i = 0; i < n; i++) { int num; cin >> num; if (num % 3 == 0) { cout << "W3" << endl; totalDistance += 3; } else if (num % 5 == 0) { cout << "E5" << endl; totalDistance += 5; } else { cout << "N10" << endl; totalDistance += 10; } } cout << totalDistance << endl; return 0; } ``` ######[AI问答 | 182点数解答 | 2025-12-06 20:19:47]

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