Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:5:15: error: expected initializer before 'n'
    5 |     long iong n, ans = 0, fac = 1;
      |               ^
/in/foo.cc:6:12: error: 'n' was not declared in this scope
    6 |     cin >> n;
      |            ^
/in/foo.cc:8:9: error: 'fac' was not declared in this scope
    8 |         fac *= i; ans += fac;
      |         ^~~
/in/foo.cc:8:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |         fac *= i; ans += fac;
      |                   ^~~
      |                   abs
/in/foo.cc:10:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     cout << ans << endl;
      |             ^~~
      |             abs

信息

递交者
类型
递交
题目
P2384 1.5.34:求阶乘的和
语言
C++
递交时间
2025-06-08 16:50:45
评测时间
2025-06-08 16:50:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes