记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:10:3: error: 'result' undeclared (first use in this function)
   result*=i;
   ^~~~~~
/in/foo.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: In function 'sum_of_factorials':
/in/foo.c:14:3: error: parameter 'sum' is initialized
   int sum=0;
   ^~~
/in/foo.c:15:3: error: expected declaration specifiers before 'for'
   for(int i=1;i<=n;i++)
   ^~~
/in/foo.c:15:15: error: expected declaration specifiers before 'i'
   for(int i=1;i<=n;i++)
               ^
/in/foo.c:15:20: error: expected declaration specifiers before 'i'
   for(int i=1;i<=n;i++)
                    ^
/in/foo.c:19:2: error: expected declaration specifiers before 'return'
  return sum;
  ^~~~~~
/in/foo.c:20:1: error: expected declaration specifiers before '}' token
 }
 ^
/in/foo.c:22:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 {
 ^
/in/foo.c:13:6: error: old-style parameter declarations in prototyped function definition
  int sum_of_factorials(int n)
      ^~~~~~~~~~~~~~~~~
/in/foo.c:27:1: error: expected '{' at end of input
 }
 ^
/in/foo.c:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
/in/foo.c: In function 'main':
/in/foo.c:27:1: error: expected declaration or statement at end of input
/in/foo.c:6:13: warning: unused variable 'sum' [-Wunused-variable]
     int i,n,sum=0;
             ^~~
At top level:
/in/foo.c:13:6: warning: 'sum_of_factorials' defined but not used [-Wunused-function]
  int sum_of_factorials(int n)
      ^~~~~~~~~~~~~~~~~

信息

递交者
类型
自测
语言
C
递交时间
2024-11-15 16:57:06
评测时间
2024-11-15 16:57:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes