Language: C

#include<stdio.h>
int main(void){
  int N,ans,i;
  ans=0;
  scanf("%d",&N);
  int A[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<N-1;i++){
    if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
    if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
  }
  for(i=0;i<N;i++){
    ans=ans+N[i];}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |         ^
main.c:11:19: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                   ^
main.c:11:29: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                             ^
main.c:11:35: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                   ^
main.c:11:40: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                        ^
main.c:11:48: error: subscripted value is neither array nor pointer nor vector
   11 |     if(N[i]<0 && N[i+1]<0){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                                ^
main.c:12:9: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |         ^
main.c:12:19: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                   ^
main.c:12:32: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                ^
main.c:12:37: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                     ^
main.c:12:45: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                             ^
main.c:12:51: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                                   ^
main.c:12:56: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                                        ^
main.c:12:64: error: subscripted value is neither array nor pointer nor vector
   12 |     if(N[i]<0 && N[i+1]>0 && -N[i]>N[i+1]){N[i]=-N[i],N[i+1]=-N[i+1];}
      |                                                                ^
main.c:15:14: error: subscripted value is neither array nor pointer nor vector
   15 |     ans=ans+N[i];}
      |              ^