酷代码 AI
菜单
服务商
DeepSeek字节豆包
更多选项

C++实现:按时间累计能量直到满足阈值

```cpp #include <iostream> using namespace std; int main() { int n; cin >> n; int total = 0, t = 0; while (total < n) { t++; total += t * (t + 1) / 2; } cout << t << endl; return 0; } ``` ######[AI问答 | 94点数解答 | 2026-06-30 17:39:44]

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