酷代码 AI
菜单
服务商

C++ 编程:巨龙喷火,求解石块首次超 50 热量的总值!

```cpp #include <iostream> using namespace std; int main() { int n; // 读取喷火次数 cin >> n; int totalHeat = 0; for (int i = 0; i < n; i++) { int heat; // 读取每次火焰的热量 cin >> heat; totalHeat += heat; // 判断总热量是否超过50 if (totalHeat > 50) { cout << totalHeat << endl; break; } } return 0; } ``` ######[AI问答 | 139点数解答 | 2025-10-25 19:16:46]

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