酷代码 AI
菜单
服务商

C++ 实现:计算人工智能传送 n 人所需总能量(n<10)

```cpp #include <iostream> using namespace std; int main() { int n; cin >> n; int totalEnergy = 0; int currentCost = 10; for (int i = 0; i < n; i++) { totalEnergy += currentCost; currentCost += 5; } cout << totalEnergy << endl; return 0; } ``` ######[AI问答 | 90点数解答 | 2025-12-07 14:17:25]

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