criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
int main(void){
   int n,i,num[n],temp;
   scanf("%d",&n);
   for(i=0;i<=n-1;i++){
       scanf("%d",&num[i]);
   }
   for(i=0;i<=n-2;i++){
       if(num[i]>num[i+1]){
           temp=num[i];
           num[i]=num[i+1];
           num[i+1]=num[i];
       }
    for(i=0;i<=n-1;i++){
        if(i) printf(" ");
        printf("%d",num[i]);
    }
   printf("\n");
   
   return 0;
   }


Compiler output:
main.c: In function 'main':
main.c:21:4: error: expected declaration or statement at end of input
   21 |    }
      |    ^
Language: C

#include<stdio.h>
main() {
	int a[10000];
	int n, i;
	scanf("%d", &n);
	for (i = 0;i < n;i++) {
		scanf("%d", &a[i]);
	}
	
	for (int j = 0;j <n/2;j++) {
		int b = a[j];
		a[j] = a[n - j - 1];
		a[n - j - 1] = b;
	}
	for (int k = 0;k < n;k++) {
		printf(" %d", a[k]);
                putchar('\n')
	}
		
}


Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main() {
      | ^~~~
main.c: In function 'main':
main.c:17:30: error: expected ';' before '}' token
   17 |                 putchar('\n')
      |                              ^
      |                              ;
   18 |         }
      |         ~
Language: C

#include<stdio.h>
main() {
	int a[10000];
	int n, i;
	scanf("%d", &n);
	for (i = 0;i < n;i++) {
		scanf("%d", &a[i]);
	}
	
	for (int j = 0;j <n/2;j++) {
		int b = a[j];
		a[j] = a[n - j - 1];
		a[n - j - 1] = b;
	}
	for (int k = 0;k < n;k++) {
		printf("%d", a[k]);
                
	}
        printf("\n")
        

}


Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main() {
      | ^~~~
main.c: In function 'main':
main.c:19:21: error: expected ';' before '}' token
   19 |         printf("\n")
      |                     ^
      |                     ;
......
   22 | }
      | ~
Language: C

#include <stdio.h>
int main(void){
   
   int n,i;
   int x[100];
   
   scanf("%d",&n);
   
   for(i=1;i<=n;i++){
       scanf("%d",&x[i]);
   }
   
   for(i=n;i>=1;i--){
       if(i!=1)
       printf("%d ",x[i]);
       else
       printf("%d\n",x[i]);
   }
   
   
   
   return 0;



Compiler output:
main.c: In function 'main':
main.c:22:4: error: expected declaration or statement at end of input
   22 |    return 0;
      |    ^~~~~~
Language: C

#include <stdio.h>

int main(void){
  int a[100],i,n;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    a[i] = 0;
    scanf("%d",&a[i]);
  }
  for(i = n - 1; i => 0; i--){
    printf("%d",a[i]);
  }
  printf("\n");
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:21: error: expected expression before '>' token
   10 |   for(i = n - 1; i => 0; i--){
      |                     ^
Language: C

#include<stdio.h>
 #define MAX 2000000
 #define K 10010 int A[MAX], B[MAX];
 void CountingSort(int A[], int N, int B[]) 
{
 int C[K] = { 0 };
 for (int i = 0;
 i < N;
 i++) 
 {
 C[A[i]]++;
 }
 for (int i = 1;
 i < K;
 i++) 
{
 C[i] += C[i - 1];
 }
 for (int i = N - 1;
 i >= 0;
 i--)
 {
 C[A[i]]--;
 B[C[A[i]]] = A[i];
 }
 }
 int main()
 {
 int N;
 scanf("%d", &N);
 for (int i = 0;
 i < N;
 i++)
 {
 scanf("%d", &A[i]);
 }
 CountingSort(A, N, B);
 for (int i = 0;
 i < N;
 i++)
 {
 if (i)printf(" ");
 printf("%d",B[i]);
 }
 printf("\n");
 return 0;
 }


Compiler output:
main.c: In function 'CountingSort':
main.c:3:18: error: expected ']' before 'int'
    3 |  #define K 10010 int A[MAX], B[MAX];
      |                  ^~~
main.c:6:8: note: in expansion of macro 'K'
    6 |  int C[K] = { 0 };
      |        ^
main.c:11:2: error: 'C' undeclared (first use in this function)
   11 |  C[A[i]]++;
      |  ^
main.c:11:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:18: error: expected ';' before 'int'
    3 |  #define K 10010 int A[MAX], B[MAX];
      |                  ^~~
main.c:14:6: note: in expansion of macro 'K'
   14 |  i < K;
      |      ^
main.c:14:7: error: expected expression before ';' token
   14 |  i < K;
      |       ^
main.c: In function 'main':
main.c:35:15: error: 'A' undeclared (first use in this function)
   35 |  scanf("%d", &A[i]);
      |               ^
main.c:37:21: error: 'B' undeclared (first use in this function)
   37 |  CountingSort(A, N, B);
      |                     ^
Language: C

#include<stdio.h>

int main(){
  int n,i,a;
  int day[n];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
  }
  for(i=0;i<n;i++){
    printf("%d",a[n-i]);
  }
  printf("%\n");
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:11:18: error: subscripted value is neither array nor pointer nor vector
   11 |     printf("%d",a[n-i]);
      |                  ^
Language: C

#include<stdio.h>
#define N (8)
int main(void)
{
	int arr[N],i;

	for(i=0;i<N;i++){
		printf("[%d]=",i),scanf("%d",&arr[i]);
	}

	for(i=0; i<N/2; i++){

	int t=arr[i];
	arr[i]=arr[N-1-i];
	arr[N-1-i]=t;
	}

	for(i=0;i<N,i++){
	printf("%d",arr[i]);
	}
	putcar("\n");
return 0;
}



Compiler output:
main.c: In function 'main':
main.c:18:24: error: expected ';' before ')' token
   18 |         for(i=0;i<N,i++){
      |                        ^
      |                        ;
main.c:21:9: error: implicit declaration of function 'putcar'; did you mean 'putchar'? [-Wimplicit-function-declaration]
   21 |         putcar("\n");
      |         ^~~~~~
      |         putchar
Language: C


#include <stdio.h> 
int main(void) 
{ 
  int i, j, tmp; 
  int number[100]; 
  int total; 
  scanf("%d", &total); 
 for (i=0; i<total; ++i) 
    scanf("%d", &number[i]); 
  for (i=0; i<total; ++i) { 
    for (j=i+1; j<total; ++j) { 
        tmp =  number[i]; 
        number[i] = number[j]; 
        number[j] = tmp; 
      } 

  } 
  for (i=0; i<total; ++i) 
    printf("%d ", number[i]); 
    }
    return 0;
} 


Compiler output:
main.c:22:5: error: expected identifier or '(' before 'return'
   22 |     return 0;
      |     ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

n=int(input())
a=list(map(int,input().split()))
a.reverse()
for x in range(n):
    if x==n-1:
        print(a[x])
    else:
        print(a[x],end=" ")


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n=int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: expected expression before 'int'
    1 | n=int(input())
      |   ^~~
Language: C

import java.util.Scanner;
class a20{
	public static void main(String args[]){
		int n,i;
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		int a[]=new int[n];
		for(i=0;i<n;i++)
			a[i]=sc.nextInt();
		for(i=n-1;i>0;i--)
			System.out.print(a[i]+" ");
		System.out.println(a[0]);
	}
}
  


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'class'
    2 | class a20{
      | ^~~~~
main.c:2:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class a20{
      |          ^
Language: C

import java.util.Scanner;
class Main{
	public static void main(String args[]){
		int n,i;
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		int a[]=new int[n];
		for(i=0;i<n;i++)
			a[i]=sc.nextInt();
		for(i=n-1;i>0;i--)
			System.out.print(a[i]+" ");
		System.out.println(a[0]);
	}
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'class'
    2 | class Main{
      | ^~~~~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class Main{
      |           ^
Language: C

#include<stdio.h>

int main()
{
	int n, a[];
	
	scanf("%d", &n);
	
	for(int i=0; i<n; i++){
		scanf("%d",&a[i]);
	}
	
	for(int j=n-1; j>=0; j--){
		printf("%d",a[j]);
		if(j != 0)printf(" ");
	}
	
	printf("\n");
	
	return 0;
	
}


Compiler output:
main.c: In function 'main':
main.c:5:16: error: array size missing in 'a'
    5 |         int n, a[];
      |                ^
Language: C

#include <stdio.h>
#define NUMBER 100
main()
{
	int i, n, x[100];
	scanf("%d\n", &n);
	for (i=0;i<n;i++){
		scanf("%d\n", &x[i]);
		
	}
	for (i=n-1; i>=0; i--){
	 printf("%d", x[i]);
         if (i==0)
		printf("\n");
	 else 
                print(" ");
}
}



Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:16:17: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   16 |                 print(" ");
      |                 ^~~~~
      |                 printf
Language: C

 int i,n,tmp;

   scanf("%d",&n);

   int a[n];

   for(i=0;i<n;i++){

       scanf("%d",&a[i]);

   }

   for(i=0;i<n/2;i++){

       tmp =a[i];

       a[i]    =a[n-1-i];

       a[n-1-i]  =tmp;

   }

   for ( i = 0; i < n; i++ ){

   if ( i ) printf(" ");

   printf("%d", a[i]);

   }

   printf("\n");

return 0;

   

}


Compiler output:
main.c:3:10: error: expected declaration specifiers or '...' before string constant
    3 |    scanf("%d",&n);
      |          ^~~~
main.c:3:15: error: expected declaration specifiers or '...' before '&' token
    3 |    scanf("%d",&n);
      |               ^
main.c:5:8: error: variably modified 'a' at file scope
    5 |    int a[n];
      |        ^
main.c:7:4: error: expected identifier or '(' before 'for'
    7 |    for(i=0;i<n;i++){
      |    ^~~
main.c:7:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |    for(i=0;i<n;i++){
      |             ^
main.c:7:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |    for(i=0;i<n;i++){
      |                 ^~
main.c:13:4: error: expected identifier or '(' before 'for'
   13 |    for(i=0;i<n/2;i++){
      |    ^~~
main.c:13:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   13 |    for(i=0;i<n/2;i++){
      |             ^
main.c:13:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   13 |    for(i=0;i<n/2;i++){
      |                   ^~
main.c:23:4: error: expected identifier or '(' before 'for'
   23 |    for ( i = 0; i < n; i++ ){
      |    ^~~
main.c:23:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   23 |    for ( i = 0; i < n; i++ ){
      |                   ^
main.c:23:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   23 |    for ( i = 0; i < n; i++ ){
      |                         ^~
main.c:31:11: error: expected declaration specifiers or '...' before string constant
   31 |    printf("\n");
      |           ^~~~
main.c:33:1: error: expected identifier or '(' before 'return'
   33 | return 0;
      | ^~~~~~
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
    int n;
    scanf("%d",&n);
    int a[n];
    for(int i = 0; i < n;i++){
        scanf("%d",&a[i]);
    }
    for(int i = n-1; i > =0; i--){
        if(i != 0){
            printf("%d",a[i]);
        }
        else{
            printf("%d\n",a[i]);
        }
    }
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:26: error: expected expression before '=' token
    9 |     for(int i = n-1; i > =0; i--){
      |                          ^
Language: C

#include<stdio.h> int main() { int a,b[10000],c,d,s,i; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&b[i]); } d=a-1; for(i=d;i>=0;i--){ if (i>0)printf("%d ",b[i]); else printf("%d",b[i]); } printf("\n"); return 0; } 


Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include<stdio.h> int main() { int a,b[10000],c,d,s,i; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&b[i]); } d=a-1; for(i=d;i>=0;i--){ if (i>0)printf("%d ",b[i]); else printf("%d",b[i]); } printf("\n"); return 0; }
      |                   ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

int main(void){
 int a[105];
 int i,n;
 scanf("%d",&n);
 for(i=0;i<n;i++)scanf("%d",&a[i]);
 for(i=n-1;i>=0;i--){
  printf("%d",a[i]);
  i!=n-1?printf(" "):printf("\n");
 puts("");
 return 0;
}



Compiler output:
main.c: In function 'main':
main.c:13:1: error: expected declaration or statement at end of input
   13 | }
      | ^
Language: C

#include<stdio.h>

int main(void){
 int a[105];
 int i,n;
 scanf("%d",&n);
 for(i=0;i<n;i++)scanf("%d",&a[i]);
 for(i=n-1;i>=0;i--){
  printf("%d",a[i]);
  i!=n-1 ? printf(" "):printf("\n");
 puts("");
 return 0;
}



Compiler output:
main.c: In function 'main':
main.c:13:1: error: expected declaration or statement at end of input
   13 | }
      | ^
Language: C

#include <stdio.h>


int main(){
    int i, n;
    int arr[100];
    scanf("%d", &n);
    for(i=0;i<n;i++){
        scanf("%d", &arr[i]);
    }
    for(i=0;i<n;i++){
        if(i)　printf("　");
        printf("%d", arr[n-i-1]);
    }
    printf("\n");
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:12:14: error: stray '\343' in program
   12 |         if(i)<U+3000>printf("<U+3000>");
      |              ^~~~~~~~
Language: C

#include <stdio.h>

//メイン関数
int main(void){
  int n;
  scanf("%d", &n);

  int a[n];
  for(int i=0; i<n; i++){
    scanf("%d" &a[i]);
  }

  for(int i=n-1; i>=0 ; i--){
    if(i != 0){
      printf("%d ", a[i]);
    }else{
      printf("%d\n", a[i]);
    }
  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:16: error: invalid operands to binary & (have 'char *' and 'int')
   10 |     scanf("%d" &a[i]);
      |           ~~~~ ^~~~~
      |           |      |
      |           char * int
Language: C

#include <stdio.h>
int main(void){
  int n;
  int tmp;

  scanf("%d\n",&n);
  int num[n];

  for(int i = 0; i < n; i++){
    scanf("%d\n",&num[i]);
  }
  for(int i = (n-1); i >= 0; i--){
      printf("%d ",num[i]);
    }
    printf("\n",num[i]);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:21: error: 'i' undeclared (first use in this function)
   15 |     printf("\n",num[i]);
      |                     ^
main.c:15:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include <stdio.h>
int main(void){
int n;
scanf("%d\n",&n);

int a[100];

int i,j,value;
for(i=0;i<n;++i)
   scanf("%d",&a[i]);


for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
        if(a[i]<a[j]){
            value=a[i];
            a[i]=a[j];
            a[j]=value;
        }
    }
}
for(i=0;i<n;i++){
if(i < n){
printf("%d ",a[i]);
}
else{
printf("%d",a[i]);
}
}
return 0;
}




Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

include <stdio.h>
int main(void){
int n;
scanf("%d\n",&n);

int a[100];

int i,j,value;
for(i=0;i<n;++i)
   scanf("%d",&a[i]);


for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
        if(a[i]<a[j]){
            value=a[i];
            a[i]=a[j];
            a[j]=value;
        }
    }
}
for(i=0;i<n;i++){
if(i < n){
printf("%d",a[i]);
printf(" ");
}
else{
printf("%d",a[i]);
}
}
return 0;
}




Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>
int main(void){
    
    int a[1000];
    int I, n;
    
     scanf("%d", &n);
     for(i = 0; i < n; i++) {
        scanf("%d", &a[i]);
  }
        if(i)
            printf("");
        for(i = 0; i < n; i++) {
         printf(" %d", a[i]);  
        }
        
  printf("\n");
}



Compiler output:
main.c: In function 'main':
main.c:8:10: error: 'i' undeclared (first use in this function)
    8 |      for(i = 0; i < n; i++) {
      |          ^
main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
      int a[1000];
      int i, n;
      scanf("%d", &n);
      for(i = 0; i < n; i++) {
          scanf("%d", &a[i]);
      }
      for(i = n-1; i >=1; i--) {
          printf("%d ", a[i]);　
      }
      printf("%d",a[0]); 
      return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:31: error: stray '\343' in program
   10 |           printf("%d ", a[i]);<U+3000>
      |                               ^~~~~~~~
Language: C

#include <stdio.h>
int main(void){
      int a[1000];
      int i, n;
      scanf("%d", &n);
      for(i = 0; i < n; i++) {
          scanf("%d", &a[i]);
      }
      for(i = n-1; i >=1; i--) {
          printf("%d ", a[i]);　
      }
      printf("%d\n",a[0]); 
      return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:31: error: stray '\343' in program
   10 |           printf("%d ", a[i]);<U+3000>
      |                               ^~~~~~~~
Language: C

#include<stdio.h>
int main(void){
	int n;
	scanf("%d",&n);
	int a[100],i;
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	for(int j= 0;j<n/2;;j++){
	int x = a[j];
	a[j] = a[n-j-1];
	a[n-j-1] = x;
	}

	for(int k=0;k<n;k++){
	printf("%d\n",a[k]);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:28: error: expected expression before ';' token
    8 |         for(int j= 0;j<n/2;;j++){
      |                            ^
Language: C

#include<stdio.h>
int main(void){
	int n;
	scanf("%d",&n);
	int a[100],i;
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	for(int j= 0;j<n/2;;j++){
	int x = a[j];
	a[j] = a[n-j-1];
	a[n-j-1] = x;
	}

	for(int k=0;k<n;k++){
	printf("%d ",a[k]);
	}
	printf("\n");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:28: error: expected expression before ';' token
    8 |         for(int j= 0;j<n/2;;j++){
      |                            ^
Language: C

#include<stdio.h>
int main(void){
	int n;
	scanf("%d",&n);
	int a[100],i;
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	for(int j= 0;j<n/2;;j++){
	int x = a[j];
	a[j] = a[n-j-1];
	a[n-j-1] = x;
	}

	for(int k=0;k<n;k++){
	if(k==n-1) printf("%d\n",a[k]);
	printf("%d ",a[k]);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:28: error: expected expression before ';' token
    8 |         for(int j= 0;j<n/2;;j++){
      |                            ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void){
int i,n;
int a[100];

scanf("%d",&n);
for(i=0;i<=n;i++){
scanf("%d",&a[i]);}
for(i=n;i>=0;i—){
printf("%d",&a[i]);}
printf("\n");
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:15: error: stray '\342' in program
   12 | for(i=n;i>=0;i<U+2014>){
      |               ^~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void){
int i;
int n;
int a[100];

scanf("%d",&n);
for(i=0;i<=n;i++){
scanf("%d",&a[i]);}
for(i=n;i>=0;i—){
printf("%d",&a[i]);}
printf("\n");
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:15: error: stray '\342' in program
   13 | for(i=n;i>=0;i<U+2014>){
      |               ^~~~~~~~
Language: C

#include<stdio.h>
int main()
{
  int a[101],c,d,i;
  scanf("%d",&c);
  for(i=0;i<c;i++){
    scanf("%d",&a[i]);}
  d=c-1;
  for(i=d;i>=0;i--){
    printf("%d",b[i]);
  }
  printf("\n");
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:17: error: 'b' undeclared (first use in this function)
   10 |     printf("%d",b[i]);
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
      int num[100]; int i,n;
      scanf("%d",&n);
       for(i=0;i<n;i++){
            scanf("%d",&num[i]);
          }
       for( i=n-1; i>0; i--){
            printf("%d "num[i]);
          }
           printf("%d\n",num[0]);
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:25: error: expected ')' before 'num'
   10 |             printf("%d "num[i]);
      |                   ~     ^~~
      |                         )
Language: C

#include <stdio.h>

int main(void) {

	int a[100];
	int b,c,i;
	
	scanf("%d",&b)
		
	for(i=0;i<b;i++){
		scanf("%d",a[i]);
	}
	
	for(i=0;i<b;j++){
		for(j=i;j<b;j++){
			c=a[i];
			a[i]=a[i+1];
			a[i+1]=c
		}
	}
	
	for(i=0;i<b;i++){
		printf("%d",a[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:23: error: expected ';' before 'for'
    8 |         scanf("%d",&b)
      |                       ^
      |                       ;
    9 | 
   10 |         for(i=0;i<b;i++){
      |         ~~~
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(){

int n;
int i;

scanf("%d", &n);

int array[n];

for ( i = 0; i < n ; i++){
        scanf("%d", &array[i]);
}

for ( i = 0; i < n ; i++){
        printf("%d ", array[n-1-i]);
}
        printf("\n");

return 0;

Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | return 0;
      | ^~~~~~
Language: C

#include <iostream>
using namespace std;

int main(void)
{
	int n;
	int a[100];

	cin >> n;

	for(int i = 0; i < n; i++)
		cin >> a[i];
	for(int i = n - 1; i >= 0; i--)
		cout << a[i] << " ";
	cout << endl;
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
	cin >> n;
	int *array = new int[n];
	for(int i = 0; i < n; i++){
		cin >> array[i];
	}

	for(int i = n - 1; i >=0; i--){
		cout << array[i] << " ";
	}

	cout << endl;
	
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a;
	cin >> a;
	int A[a]
	for (int i = a-1; i >= 0; i--)
		cin >> A[i];
	for (int i = 0; i <= a; i++)
		cout << A[i] << ' ';
	cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'for'
    8 |         for (int i = a-1; i >= 0; i--)
      |         ^~~
a.cc:8:27: error: 'i' was not declared in this scope
    8 |         for (int i = a-1; i >= 0; i--)
      |                           ^
a.cc:11:25: error: 'A' was not declared in this scope
   11 |                 cout << A[i] << ' ';
      |                         ^
Language: C++

#include <stdio.h>
 
using namespace std;
 
int main(){
    int n;
    scanf("%d",&n);
    int A[n];
 
    for(int i = 0; i < n; i++) scanf("%d",&A[i]);
 
    for(int i = n-1; i > 0; i--) printf("%d ",A[i]);
    printf("%d\n",A[0]);
}


Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |     int n;
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |     scanf("%d",&n);
      | ^
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
    8 |     int A[n];
      | ^
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
    9 |  
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
   10 |     for(int i = 0; i < n; i++) scanf("%d",&A[i]);
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |  
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |     for(int i = n-1; i > 0; i--) printf("%d ",A[i]);
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |     printf("%d\n",A[0]);
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
Language: C++

#include<iostream>
using namespace std;

int main() {
	cin >> n;
	for ( int i = 0; i < n; i++ ) cin >> A[i];
	
	for ( int i = n-1; i >= 0; i-- ) {
		if ( i != n-1 ) cout << " ";
		cout << A[i];
	}
	cout << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'n' was not declared in this scope
    5 |         cin >> n;
      |                ^
a.cc:6:46: error: 'A' was not declared in this scope
    6 |         for ( int i = 0; i < n; i++ ) cin >> A[i];
      |                                              ^
a.cc:10:25: error: 'A' was not declared in this scope
   10 |                 cout << A[i];
      |                         ^
Language: C++

int main(void)
{
    int a, b, c[1000], d;

    scanf("%d", &a);
    
    for(b=0;b<a;b++)
    {
        scanf("%d", &c[b]);

    }

    for (d = a-1;(d <=a-1)&&(0<=d);d--)
    {
        if (d != 0)
        {
            printf("%d ", c[d]);
        }
        else
        {
            printf("%d", c[d]);
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'scanf' was not declared in this scope
    5 |     scanf("%d", &a);
      |     ^~~~~
a.cc:17:13: error: 'printf' was not declared in this scope
   17 |             printf("%d ", c[d]);
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:21:13: error: 'printf' was not declared in this scope
   21 |             printf("%d", c[d]);
      |             ^~~~~~
a.cc:21:13: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

int main(void)
{
    int a, b, c[1000], d;

    scanf("%d", &a);
    
    for(b=0;b<a;b++)
    {
        scanf("%d", &c[b]);

    }

    for (d = a-1;(d <=a-1)&&(0<=d);d--)
    {
        if (d != 0)
        {
            printf("%d ", c[d]);
        }
        else
        {
            printf("%d\n", c[d]);
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'scanf' was not declared in this scope
    5 |     scanf("%d", &a);
      |     ^~~~~
a.cc:17:13: error: 'printf' was not declared in this scope
   17 |             printf("%d ", c[d]);
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:21:13: error: 'printf' was not declared in this scope
   21 |             printf("%d\n", c[d]);
      |             ^~~~~~
a.cc:21:13: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
vector<int> a;

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n)cin>>a[i];
	
	rep(i, n)cout<<a[n-i-1]<<(i==n-1?'':' ');
	
	return 0;
}



Compiler output:
a.cc:21:42: error: empty character constant
   21 |         rep(i, n)cout<<a[n-i-1]<<(i==n-1?'':' ');
      |                                          ^~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
vector<int> a(100);

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n)cin>>a[i];
	
	rep(i, n)cout<<a[n-1-i]<<(i==n-1?'':' ');
	
	return 0;
}



Compiler output:
a.cc:21:42: error: empty character constant
   21 |         rep(i, n)cout<<a[n-1-i]<<(i==n-1?'':' ');
      |                                          ^~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
vector<int> a(100);

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n) cin>>a[i];
	
	rep(i, n) cout<<a[n-1-i]<<(i==n-1?'':' ');
	
	return 0;
}



Compiler output:
a.cc:21:43: error: empty character constant
   21 |         rep(i, n) cout<<a[n-1-i]<<(i==n-1?'':' ');
      |                                           ^~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
vector<int> a(100);

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n) cin>>a[i];
	
	rep(i, n) cout<<a[n-1-i]<<(i==n-1?"":' ');
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:42: error: operands to '?:' have different types 'const char*' and 'char'
   21 |         rep(i, n) cout<<a[n-1-i]<<(i==n-1?"":' ');
      |                                    ~~~~~~^~~~~~~
Language: C++

#include <iostream>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
int a[102];

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n)cin>>a[i];
	
	rrep(i, n)cout<<a[i]<<(i==0?'':' ');
	
	return 0;
}



Compiler output:
a.cc:20:37: error: empty character constant
   20 |         rrep(i, n)cout<<a[i]<<(i==0?'':' ');
      |                                     ^~
Language: C++

#include <iostream>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)

#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int n;
int a[102];

int main(){
	cin.tie(0);
	
	cin>>n;
	rep(i, n)cin>>a[i];
	
	rrep(i, n)cout<<a[i]<<(i==0?'':' ');
	
	return 0;
}



Compiler output:
a.cc:21:37: error: empty character constant
   21 |         rrep(i, n)cout<<a[i]<<(i==0?'':' ');
      |                                     ^~
Language: C++

#include <iostream>
using namespace std ;
int arr[1005];
int main() {
  int n;
  cin >> n;
  for (int i = n-1 ; i >= 0 ; i-- ) {
    cin >> arr[i] ; 

  for ( int i = 0 ; i < n ; i++ ) 
      cout << a[i] << ' ' ;

  cout << endl ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'a' was not declared in this scope
   11 |       cout << a[i] << ' ' ;
      |               ^
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std ;
int a[1005];
int main() {
  int n;
  cin >> n;
  for (int i = n-1 ; i >= 0 ; i-- ) 
    cin >> a[i] ; 

  for ( int i = 0 ; i < n ; i++ ) 
      cout << a[i] << ' ' ; 

  cout << endl ;
  return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before '}' token
   14 |   return 0
      |           ^
      |           ;
   15 | }
      | ~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  int b,a[100];
  cin>>b;
  for(int i=0;i<b;i++){
    cin>>a[i];
  }
  for(int i=b-1;i>=0;i--){
    cout<<" "a[i];
  }
  cout<<endl;
  
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: unable to find string literal operator 'operator""a' with 'const char [2]', 'long unsigned int' arguments
   12 |     cout<<" "a[i];
      |           ^~~~
Language: C++

#include <iostream>
#include <cmath>
//#include <string>
using namespace std;
int main(){
    
    int a;
    cin>>a;
    int in[a];
    int sum=0;
    for(int i=0;i<a;i++){
        cin>>in[i];
        sum++;
    }
    
    for(int j=sum-1;j>=0;j--){
        if(j==0)cout<<in[j]<<endl;;
        else cout<<in[j]<<' ';
    }
    
    
    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'else' without a previous 'if'
   18 |         else cout<<in[j]<<' ';
      |         ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a.at(i);
    reverse(a.begin(), a,end());
    for(int i=0; i<n; i++){
        cout << a.at(i);
        if (i != length(a) - 1) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: no matching function for call to 'end()'
   10 |     reverse(a.begin(), a,end());
      |                          ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(a.begin(), a,end());
      |     ^~~~~~~
a.cc:13:18: error: 'length' was not declared in this scope
   13 |         if (i != length(a) - 1) cout << " ";
      |                  ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a.at(i);
    reverse(a.begin(), a,end());
    for(int i=0; i<n; i++){
        cout << a.at(i);
        if (i != a.length() - 1) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: no matching function for call to 'end()'
   10 |     reverse(a.begin(), a,end());
      |                          ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(a.begin(), a,end());
      |     ^~~~~~~
a.cc:13:20: error: 'class std::vector<int>' has no member named 'length'
   13 |         if (i != a.length() - 1) cout << " ";
      |                    ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a.at(i);
    reverse(a.begin(), a,end());
    for(int i=0; i<n; i++){
        cout << a.at(i);
        if (i != a.length() - 1) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: no matching function for call to 'end()'
   11 |     reverse(a.begin(), a,end());
      |                          ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
a.cc:14:20: error: 'class std::vector<int>' has no member named 'length'
   14 |         if (i != a.length() - 1) cout << " ";
      |                    ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a.at(i);
    reverse(a.begin(), a,end());
    for(int i=0; i<n; i++){
        cout << a.at(i);
        if (i != length(a) - 1) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: no matching function for call to 'end()'
   11 |     reverse(a.begin(), a,end());
      |                          ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
a.cc:14:18: error: 'length' was not declared in this scope
   14 |         if (i != length(a) - 1) cout << " ";
      |                  ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a.at(i);
    reverse(a.begin(), a.end());
    for(int i=0; i<n; i++){
        cout << a.at(i);
        if (i != length(a) - 1) cout << " ";
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'length' was not declared in this scope
   14 |         if (i != length(a) - 1) cout << " ";
      |                  ^~~~~~
Language: C++

#include<stdio.h>
using namespace std;
int main(){
    int n = 0;
    while(1){
    	scanf("%d", &n);
	int*a = new int [n];
	for (int i = 0;i < n;i++) {
		a[i] = scanf("%d", &a[i]);
	}

	for (int i = 0;i < n;i++) {
		printf("%d", a[n - i - 1]);
		if (i != 4) {
			printf(" ");
		}
	}
    }
	delete[]a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'a' was not declared in this scope
   19 |         delete[]a;
      |                 ^
Language: C++

#include<stdio.h>
using namespace std;
int main(){
    int n = 0;
    while(1){
    	scanf("%d", &n);
	int*a = new int [n];
	for (int i = 0;i < n;i++) {
		a[i] = scanf("%d", &a[i]);
	}

	for (int i = 0;i < n;i++) {
		printf("%d", a[n - i - 1]);
		if (i != 4) {
			printf(" ");
		}
	    }
    }
	delete[]a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'a' was not declared in this scope
   19 |         delete[]a;
      |                 ^
Language: C++

#include<stdio.h>
using namespace std;

int main(){
    int n = 0;
    	scanf("%d", &n);
	int*a = new int [n];
	for (int i = 0;i < n;i++) {
		a[i] = scanf("%d", &a[i]);
	}

	for (int i = 0;i < n;i++) {
		printf("%d", a[n - i - 1]);
		if (i != n - 1) {
			printf(" ");
		}
		else{
		    printf("\n")
		}
	}
	delete[]a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: expected ';' before '}' token
   18 |                     printf("\n")
      |                                 ^
      |                                 ;
   19 |                 }
      |                 ~