/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:6:5: error: 'sum' undeclared (first use in this function)
    6 |     sum=arr[i];
      |     ^~~
foo.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
foo.c:6:9: error: 'arr' undeclared (first use in this function)
    6 |     sum=arr[i];
      |         ^~~
foo.c:9:28: error: expected ';' before 'for'
    9 |     if(arr[i] > max)max=arr
      |                            ^
      |                            ;
   10 |     for(int i =n-1;i>=;i++)
      |     ~~~                     

Code

#include <stdio.h>
int main(){
    int i;
    char n;
    for(int i=1;i<n;i++)
    sum=arr[i];
    int max =arr[0];
    for(int i=1;i<n;i++)
    if(arr[i] > max)max=arr
    for(int i =n-1;i>=;i++)
    printf("%d",arr[i]);
    return 0;
    }

Information

Submit By
Type
Submission
Problem
P1227 LUCC Party Check-in
Contest
LUCC Presents Kick & Code Intra LU Programming Contest
Language
C11 (GCC 13.2.0)
Submit At
2025-09-01 06:36:38
Judged At
2025-09-01 06:36:38
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes