酷代码 AI
菜单
服务商

C++实现:求解 1!+2!+3!+…+n!(n≤50)的代码解析

```cpp #include <iostream> using namespace std; int main() { int n; cin >> n; long long factorial = 1; long long sum = 0; for (int i = 1; i <= n; i++) { factorial *= i; sum += factorial; } cout << sum << endl; return 0; } ``` ######[AI问答 | 99点数解答 | 2025-09-26 19:32:04]

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