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

#include <bits/stdc++.h>
using namespace std;

int n;
int a[1000];

int main() {
  cin >> n;
  for (int b = 0; b < n;++b) {
    cin >> a[b];
  }
  sort(a+b,a);
  for (int c = 0; c < n;++c) {
    cout << a[c];
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'b' was not declared in this scope
   12 |   sort(a+b,a);
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int n;
int a[1000];
int b = 0;
int c = 0;

int main() {
  cin >> n;
  for (; b < n;) {
    cin >> a[b];
    ++b;
  }
  sort(a+b,a);
  for (; c < n; {
    cout << a[c]
    ++c;
    if(c < n) {
      cout << " ";
    }
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected primary-expression before '{' token
   16 |   for (; c < n; {
      |                 ^
a.cc:16:16: error: expected ')' before '{' token
   16 |   for (; c < n; {
      |       ~        ^~
      |                )
a.cc:18:7: error: expected ';' before 'c'
   18 |     ++c;
      |       ^
      |       ;
Language: C++

#include<iostream>
using namespace std;

int main(){
	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];
		if (i == 0){
			break;
		}
		else{
			cout << " ";
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n, A[100];
	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:10:22: error: expected ')' before '!' token
   10 |                 if (i ! = n - 1) cout << " " ;
      |                    ~ ^~
      |                      )
Language: C++

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

int main() {
	int n;
	vector<int> a;
	scanf("%d",&n);
	a.resize(n);
	for(int i=0;i<n;++i) {
		cin >> a[i];
	}
	for(auto x=a.rbegin(); x!=(--a.rend()); ++x) {
		printf("%d ",*x);
	}
	printf("%d\n",a[0]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cin' was not declared in this scope
   11 |                 cin >> a[i];
      |                 ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <vector>
  +++ |+#include <iostream>
    3 | using namespace std;
Language: C++

#include<iostream>
int main(){
  int n,i,*A;
  std::cin >> n;
  A = new int [n];
  for(i=n-1; i>=0; i++) std::cin >> A[i];
  for(i=0; i<n; i++) std::cout << A[i] << (n % i == 1 ? std::endl : " ");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:69: error: overloaded function with no contextual type information
    7 |   for(i=0; i<n; i++) std::cout << A[i] << (n % i == 1 ? std::endl : " ");
      |                                                                     ^~~
Language: C++

#include<iostream>
#include<cstring>

#define MAX_N 101
int main(){
   int a[MAX_N];
   int n;
   memset(a,-1,sizeof(a));
   std::cin>>n;
   for(int i=0;i<n;i++)
      std::cin>>a[i];
   while(i-->=0)
      std::cout<<a[i];
   std::cout<<std::endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'i' was not declared in this scope
   12 |    while(i-->=0)
      |          ^
Language: C++

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

int main()
{
  int n, a;

  int array[100];

  cin >> n;

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

  }


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

  cout <<  n\ << endl;

  return 0;
}

Compiler output:
a.cc:26:13: error: stray '\' in program
   26 |   cout <<  n\ << endl;
      |             ^
Language: C++

#include <stdio.h>
#include <iostream> 
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
using namespace std;

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

  for (int j = x; j > 0; --j) {
    if(j == 1) {
      cout << array[j - 1]; << endl;
    } else {
      cout << array[j - 1]; << " " << flush;
    }
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
    8 |   for (int i = 0; i < x; ++i) {
      |   ^~~
a.cc:8:19: error: 'i' was not declared in this scope
    8 |   for (int i = 0; i < x; ++i) {
      |                   ^
a.cc:14:20: error: missing template arguments before '[' token
   14 |       cout << array[j - 1]; << endl;
      |                    ^
a.cc:14:29: error: expected primary-expression before '<<' token
   14 |       cout << array[j - 1]; << endl;
      |                             ^~
a.cc:16:20: error: missing template arguments before '[' token
   16 |       cout << array[j - 1]; << " " << flush;
      |                    ^
a.cc:16:29: error: expected primary-expression before '<<' token
   16 |       cout << array[j - 1]; << " " << flush;
      |                             ^~
Language: C++

#include <iostream>
using namespace std;

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

  for (int j = x; j > 0; --j) {
    if(j == 1) {
      cout << array[j - 1]; << endl;
    } else {
      cout << array[j - 1]; << " " << flush;
    }
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected primary-expression before '<<' token
   14 |       cout << array[j - 1]; << endl;
      |                             ^~
a.cc:16:29: error: expected primary-expression before '<<' token
   16 |       cout << array[j - 1]; << " " << flush;
      |                             ^~
Language: C++

#include <iostream>
int main(){
	int i,l,n;
	int a[100];

	cin >> n;
	for( i=0; i<n; i++ ) cin >> a[i];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |                 if( i != n-1 ) cout << " ";
      |                                ^~~~
      |                                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |                 cout << a[i];
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
int main(){
	int i,l,n;
	int a[100];

	cin >> n;
	for( i=0; i<n; i++ ) cin >> a[i];

	for( 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:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |                 if( i != n-1 ) cout << " ";
      |                                ^~~~
      |                                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |                 cout << a[i];
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
int k,a[100];

cin >>k;

for(int i=0;i<k;i++){
cin >>a[i];
}

for(int i=k-1;i>=0;i--){
if(i!=k-1)cout <<" ";
cout <<a[i]
}
cout <<endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before '}' token
   15 | cout <<a[i]
      |            ^
      |            ;
   16 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,a[];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: storage size of 'a' isn't known
    5 |     int n,a[];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,a[];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: storage size of 'a' isn't known
    5 |     int n,a[];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,a[];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: storage size of 'a' isn't known
    5 |     int n,a[];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,a[];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: storage size of 'a' isn't known
    5 |     int n,a[];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,a[];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: storage size of 'a' isn't known
    5 |     int n,a[];
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main(void){
	while(1){
		int H,W;
		cin>>H;
		cin>>W;
		if(H==0&&W==0){
			break;
		}else{
			for(i=0;i<H;i++){
				for(j=0;j<W;j++){
					int u;
					u=i+j;
					if(u%2==0){
						printf("#");
					}else{
						printf(".");
					}
				}
			cout<<endl;
			}
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: 'i' was not declared in this scope
   12 |                         for(i=0;i<H;i++){
      |                             ^
a.cc:13:37: error: 'j' was not declared in this scope
   13 |                                 for(j=0;j<W;j++){
      |                                     ^
Language: C++

#include <iosteram>
using namespace std;

int main(){
	int n;
	int a[100];
	cin >>???n;

	for( i=0; i>n; i++ ) cin >> a[i];

	for( i=n-1; i>=0; i-- ){
		if( i !=n-1 ) cout << " ";
		cout << a[i];
	}
	cout << endl;

	return 0;
}

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

import java.util.Scanner;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>


int main(void)
{
	using namespace std;
	
	int n;
	cin >> n;

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

	for(int i=n-1 i>0; --i) cout << data[i] << " ";
	cout << data[0] << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before 'i'
   12 |         for(int i; i<n i++){
      |                       ^~
      |                       ;
a.cc:16:22: error: expected ';' before 'i'
   16 |         for(int i=n-1 i>0; --i) cout << data[i] << " ";
      |                      ^~
      |                      ;
Language: C++

#include <iostream>


int main(void)
{
	using namespace std;
	
	int n;
	cin >> n;

	int* data = new int[n];
	for(int i=0; i<n i++)	cin >> data[i];


	for(int i=n-1; i>0; --i) cout << data[i] << " ";
	cout << data[0] << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: expected ';' before 'i'
   12 |         for(int i=0; i<n i++)   cin >> data[i];
      |                         ^~
      |                         ;
Language: C++


#include <iostream>
using namespace std;

int main()
{
    int n=0;
    cin>>n;
    int*NumArray=new int [n];
    for (int i=0;i<n;i++)
    {
        cin>>NumArray[n-i];
    }
    for (int i=0;i<n-1;i++)
    {
        cout<<NumArray[i]<<' ';
    }
    //????????????????????\?????????????´??????????????????????????????\????????????????????????
    cout<<cout[n]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: no match for 'operator[]' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   19 |     cout<<cout[n]<<endl;
      |               ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n;
 cin >> n ;
 int a[n]a,b[n];
 for(int i=0;i<n;i++) cin >> a[i] ;
 for(i=0;i<n;i++) b[i]=a[n-1-i];
 for(i=0;i<n-1;i++)cout << b[i] << " " ;
 cout << b[n-1] ;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected initializer before 'a'
    7 |  int a[n]a,b[n];
      |          ^
a.cc:8:30: error: 'a' was not declared in this scope
    8 |  for(int i=0;i<n;i++) cin >> a[i] ;
      |                              ^
a.cc:9:6: error: 'i' was not declared in this scope
    9 |  for(i=0;i<n;i++) b[i]=a[n-1-i];
      |      ^
a.cc:9:19: error: 'b' was not declared in this scope
    9 |  for(i=0;i<n;i++) b[i]=a[n-1-i];
      |                   ^
a.cc:9:24: error: 'a' was not declared in this scope
    9 |  for(i=0;i<n;i++) b[i]=a[n-1-i];
      |                        ^
a.cc:10:6: error: 'i' was not declared in this scope
   10 |  for(i=0;i<n-1;i++)cout << b[i] << " " ;
      |      ^
a.cc:10:28: error: 'b' was not declared in this scope
   10 |  for(i=0;i<n-1;i++)cout << b[i] << " " ;
      |                            ^
a.cc:11:10: error: 'b' was not declared in this scope
   11 |  cout << b[n-1] ;
      |          ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n;
 cin >> n ;
 int a[100],b[100];
 for(int i=0;i<n;i++) cin >> a[i] ;
 for(i=0;i<n;i++) b[i]=a[n-1-i];
 for(i=0;i<n-1;i++)cout << b[i] << " " ;
 cout << b[n-1] ;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 'i' was not declared in this scope
    9 |  for(i=0;i<n;i++) b[i]=a[n-1-i];
      |      ^
a.cc:10:6: error: 'i' was not declared in this scope
   10 |  for(i=0;i<n-1;i++)cout << b[i] << " " ;
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n;
 cin >> n ;
 int a[100];
 for(int i=0;i<n;i++) cin >> a[i] ;

 for(i=n;i=>0;i--){
  if(i!=0) cout << a[i] << " " ;
  else cout << a[0]; 
 }
 cout << endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'i' was not declared in this scope
   10 |  for(i=n;i=>0;i--){
      |      ^
a.cc:10:12: error: expected primary-expression before '>' token
   10 |  for(i=n;i=>0;i--){
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n,i;
 cin >> n ;
 int a[100];
 for(i=0;i<n;i++) cin >> a[i] ;

 for(i=n;i=>0;i--){
  if(i!=0) cout << a[i] << " " ;
  else cout << a[0]; 
 }
 cout << endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before '>' token
   10 |  for(i=n;i=>0;i--){
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n,i;
 cin >> n ;
 int a[100];
 for(i=0;i<n;i++) cin >> a[i] ;

 for(i=n;i=>0;i--){
  if(i=!0) cout << a[i] << " " ;
  else cout << a[0]; 
 }
 cout << endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before '>' token
   10 |  for(i=n;i=>0;i--){
      |            ^
Language: C++

#include<stdio.h>

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: conflicting declaration 'int x [n]'
    6 |   int x[n];
      |       ^
a.cc:4:11: note: previous declaration as 'int x'
    4 |   int n,i,x;
      |           ^
a.cc:8:19: error: invalid types 'int[int]' for array subscript
    8 |     scanf("%d ",&x[i]);
      |                   ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 |     printf("%d ",x[i]);
      |                   ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: expected ')' before ';' token
    7 | scanf("%d",&a[n-i-1];
      |      ~              ^
      |                     )
Language: C++

#include <cstdio>
int main(void){
    // Here your code !
    int n;
    scanf("%d", &n);
    int nums[n];
    
    for (int i = 0; i < n; i++){
        scanf("%d", num[i]);
    }
    for (int i = 0; i < n; i++){
        printf("%d ", num[n-1-i]);
        if (i == n - 1){
            printf("%d\n", num[n-1-i]);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'num' was not declared in this scope; did you mean 'nums'?
    9 |         scanf("%d", num[i]);
      |                     ^~~
      |                     nums
a.cc:12:23: error: 'num' was not declared in this scope; did you mean 'nums'?
   12 |         printf("%d ", num[n-1-i]);
      |                       ^~~
      |                       nums
Language: C++

#include <stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before ')' token
    7 |   for(i=0,i<n,i++){
      |                  ^
      |                  ;
a.cc:10:3: error: expected primary-expression before 'for'
   10 |   for(j=0,j<n-1,j++){
      |   ^~~
a.cc:9:4: error: expected ';' before 'for'
    9 |   }
      |    ^
      |    ;
   10 |   for(j=0,j<n-1,j++){
      |   ~~~
a.cc:10:3: error: expected primary-expression before 'for'
   10 |   for(j=0,j<n-1,j++){
      |   ^~~
a.cc:9:4: error: expected ')' before 'for'
    9 |   }
      |    ^
      |    )
   10 |   for(j=0,j<n-1,j++){
      |   ~~~
a.cc:7:6: note: to match this '('
    7 |   for(i=0,i<n,i++){
      |      ^
a.cc:10:20: error: expected ';' before ')' token
   10 |   for(j=0,j<n-1,j++){
      |                    ^
      |                    ;
a.cc:14:3: error: expected primary-expression before 'return'
   14 |   return 0;
      |   ^~~~~~
a.cc:13:23: error: expected ')' before 'return'
   13 |   printf("%d\n",a[0]);
      |                       ^
      |                       )
   14 |   return 0;
      |   ~~~~~~               
a.cc:10:6: note: to match this '('
   10 |   for(j=0,j<n-1,j++){
      |      ^
Language: C++

#include "cstdio"

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'for'
    7 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:7:17: error: 'i' was not declared in this scope
    7 |     for(int i=0;i<n;i++){
      |                 ^
a.cc:11:22: error: 'a' was not declared in this scope
   11 |         printf("%d ",a[j]);
      |                      ^
a.cc:13:17: error: expected ';' before '}' token
   13 |     printf("\n")
      |                 ^
      |                 ;
   14 | }
      | ~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    int[n] array;
 
    for (int i = 0; i < n; i++)
        cin >> array[i];

    cout << array[i];

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

    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: structured binding declaration cannot have type 'int'
    7 |     int[n] array;
      |        ^~~
a.cc:7:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:9: error: conflicting declaration 'auto n'
    7 |     int[n] array;
      |         ^
a.cc:5:9: note: previous declaration as 'int n'
    5 |     int n;
      |         ^
a.cc:7:12: error: expected initializer before 'array'
    7 |     int[n] array;
      |            ^~~~~
a.cc:10:21: error: missing template arguments before '[' token
   10 |         cin >> array[i];
      |                     ^
a.cc:12:18: error: missing template arguments before '[' token
   12 |     cout << array[i];
      |                  ^
a.cc:12:19: error: 'i' was not declared in this scope
   12 |     cout << array[i];
      |                   ^
a.cc:15:29: error: missing template arguments before '[' token
   15 |         cout << ' ' << array[i];
      |                             ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    int[n] array;
 
    for (int i = 0; i < n; i++)
        cin >> array[i];

    cout << array[n];

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

    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: structured binding declaration cannot have type 'int'
    7 |     int[n] array;
      |        ^~~
a.cc:7:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:9: error: conflicting declaration 'auto n'
    7 |     int[n] array;
      |         ^
a.cc:5:9: note: previous declaration as 'int n'
    5 |     int n;
      |         ^
a.cc:7:12: error: expected initializer before 'array'
    7 |     int[n] array;
      |            ^~~~~
a.cc:10:21: error: missing template arguments before '[' token
   10 |         cin >> array[i];
      |                     ^
a.cc:12:18: error: missing template arguments before '[' token
   12 |     cout << array[n];
      |                  ^
a.cc:15:29: error: missing template arguments before '[' token
   15 |         cout << ' ' << array[i];
      |                             ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    int[n] array;
 
    for (int i = 0; i < n; i++)
        cin >> array[i];

    cout << array[n];

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

    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: structured binding declaration cannot have type 'int'
    7 |     int[n] array;
      |        ^~~
a.cc:7:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:9: error: conflicting declaration 'auto n'
    7 |     int[n] array;
      |         ^
a.cc:5:9: note: previous declaration as 'int n'
    5 |     int n;
      |         ^
a.cc:7:12: error: expected initializer before 'array'
    7 |     int[n] array;
      |            ^~~~~
a.cc:10:21: error: missing template arguments before '[' token
   10 |         cin >> array[i];
      |                     ^
a.cc:12:18: error: missing template arguments before '[' token
   12 |     cout << array[n];
      |                  ^
a.cc:15:29: error: missing template arguments before '[' token
   15 |         cout << ' ' << array[i];
      |                             ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'sendl' was not declared in this scope
   16 |         cout << sendl;
      |                 ^~~~~
Language: C++

#include <iostream>

int main()
{
	int n
	std::cin >> n;
	int a[n];
	for (int i=n; i<0; --i) std::cin >> a[i];
	for (int i=0; i!=n; ++i) std]]cout << a[i] << ' ';
	std::cout << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'std'
    6 |         std::cin >> n;
      |         ^~~
a.cc:7:15: error: 'n' was not declared in this scope
    7 |         int a[n];
      |               ^
a.cc:8:45: error: 'a' was not declared in this scope
    8 |         for (int i=n; i<0; --i) std::cin >> a[i];
      |                                             ^
a.cc:9:37: error: expected primary-expression before ']' token
    9 |         for (int i=0; i!=n; ++i) std]]cout << a[i] << ' ';
      |                                     ^
Language: C++

#include <iostream>

int main()
{
	int n;
	std::cin >> n;
	int a[n];
	for (int i=n; i<0; --i) std::cin >> a[i];
	for (int i=0; i!=n; ++i) std]]cout << a[i] << ' ';
	std::cout << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:37: error: expected primary-expression before ']' token
    9 |         for (int i=0; i!=n; ++i) std]]cout << a[i] << ' ';
      |                                     ^
Language: C++

#define _USE_MATH_DEFINES

#include<math.h>
#include<stdio.h>
#include<utility>
#include<algorithm>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                 scanf_s("%d", &a[m]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int arr[50], size, i, j, temp;
	cout<<"Enter array size : ";
	cin>>size;
	cout<<"Enter array elements : ";
	for(i=0; i<size; i++)
	{
		cin>>arr[i];
	}
	j=size-1;
	i=0;
	while(i<j)
	{
		temp=arr[i];
		arr[i]=arr[j];
		arr[j]=temp;
		i++;
		j--;
	}

	for(i=0; i<size; i++)
	{
		cout<<arr[i]<<" ";a
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: 'a' was not declared in this scope
   26 |                 cout<<arr[i]<<" ";a
      |                                   ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int n, input;
  cin >> n;

  vector<int> v;
  for (int i = 0; i < n; i++)
  {
    cin >> input;
    v.push_back(input);
  }

  reverse(v.begin(), v.end());

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'reverse' was not declared in this scope
   18 |   reverse(v.begin(), v.end());
      |   ^~~~~~~
Language: C++

#include <iostream>
using namestream std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namestream'
    2 | using namestream std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |                 cout << a[j] << " ";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |         cout << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |         cout << endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

int main() {
int n;
std::cin >> n;
int* a = new int[n];

for(int i = 0; i < n; i++){
std::cin >> a[i];
}

for(int j = 0; j < n / 2; j++){
int put = a[j]
a[j] = a[n-j];
a[n-j] = put;
}

for(int l = 0; l < n; l++){
std::cout << a[l];
if(l != n-1){
std::cout << ' ';
}
}
std::cout << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: expected ',' or ';' before 'a'
   14 | a[j] = a[n-j];
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int a,b[100];
	cin >> a;
	for (int i = 0; i < a; i++) {
		cin >> b[i];
	}
	for (int i = a - 1; i >= 0; i--) {
		if (i = 0) {
			cout << b[0] << endl;
		}
		else cout << b[i] << ' ';
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main() {
int count;
int cum = 0;
cin >> count;
int array[count] = {};
while (cum < count) {
cin>> array[count - cum];
cum++
} for (int i= 0; i < count; i++) {
cout << array[i] << " ";
} cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before '}' token
   11 | cum++
      |      ^
      |      ;
   12 | } for (int i= 0; i < count; i++) {
      | ~
Language: C++

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vector<int> arr;
    int i;
    int c = 0;
    while (c < n && cin >> i)
    {
        arr.push_back(i);
        ++c;
    }

    reverse(arr.begin(), arr.end());

    REP(i2, n)
    {
        if (i2 > 0)
        {
            cout << " ";
        }

        cout << arr[i2];
    }

    cout << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'reverse' was not declared in this scope
   25 |     reverse(arr.begin(), arr.end());
      |     ^~~~~~~
Language: C++

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vector<int> arr;
    int i;
    int c = 0;
    while (c < n && cin >> i)
    {
        arr.push_back(i);
        ++c;
    }

    reverse(arr.begin(), arr.end());

    REP(i2, n)
    {
        if (i2 > 0)
        {
            cout << " ";
        }

        cout << arr[i2];
    }

    cout << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'reverse' was not declared in this scope
   24 |     reverse(arr.begin(), arr.end());
      |     ^~~~~~~
Language: C++

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vector<int> arr;
    int i;
    int c = 0;
    while (c < n && cin >> i)
    {
        arr.push_back(i);
        ++c;
    }

    std::reverse(arr.begin(), arr.end());

    REP(i2, n)
    {
        if (i2 > 0)
        {
            cout << " ";
        }

        cout << arr[i2];
    }

    cout << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'reverse' is not a member of 'std'
   24 |     std::reverse(arr.begin(), arr.end());
      |          ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int num;
    int *a;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<num;i++){
      |         ^
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=num-1;i>0;i--){
      |         ^
Language: C++

#include <cstdio>

int main()
{
    int n;
    cin >> n; 
    int number[1000];
    for(int i = 0; i < n; i++){
        int t;
        cin >> t;
        number[i] = t;
    }

    for(int i = n; i > 0; i--){
        printf("%d\n", number[i]);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
Language: C++

#include <cstdio>

int main()
{
    int n;
    cin >> n; 
    int number[1000];
    for(int i = 0; i < n; i++){
        int t;
        cin >> t;
        number[i] = t;
    }

    for(int i = n; i > 0; i--){
        printf("%d\n", number[i]);
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i = 0; i < n; i++) cin >> A[i];
      |         ^
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i = 1; i < n; i++) cout << " " << A[n - 1 - i];
      |         ^
Language: C++

#include<cstdio>
using namespace std;
int main(){
    int len;
    scanf("%d",&len);
    int x[len];
    for(int i=0;i<len;i++){
        scanf("%d",&x[i]);
    }
    for(int j=len-1;j>=0;j--){
        printf("%d ",&x[i]);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'i' was not declared in this scope
   11 |         printf("%d ",&x[i]);
      |                         ^
Language: C++

#include<cstdio>
using namespace std;
int main(){
    int len;
    scanf("%d",&len);
    int x[len];
    for(int i=0;i<len;i++){
        scanf("%d",&x[i]);
    }
    for(int j=(len-1);j>=0;j--){
        printf("%d ",&x[i]);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'i' was not declared in this scope
   11 |         printf("%d ",&x[i]);
      |                         ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: declaration does not declare anything [-fpermissive]
    7 |     for(int;i=0;i<n;i++) cin>>a[i];
      |         ^~~
a.cc:7:13: error: 'i' was not declared in this scope
    7 |     for(int;i=0;i<n;i++) cin>>a[i];
      |             ^
a.cc:7:20: error: expected ')' before ';' token
    7 |     for(int;i=0;i<n;i++) cin>>a[i];
      |        ~           ^
      |                    )
a.cc:7:21: error: 'i' was not declared in this scope
    7 |     for(int;i=0;i<n;i++) cin>>a[i];
      |                     ^
a.cc:8:9: error: declaration does not declare anything [-fpermissive]
    8 |     for(int;i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
      |         ^~~
a.cc:8:24: error: expected ')' before ';' token
    8 |     for(int;i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
      |        ~               ^
      |                        )
Language: C++

#include<bits/stdc++.h>
using namespace std;

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

cin>>n;
for(i=1;i<=n;i++){
cin>>a[i];
}
i=n;
for(;;){
if(i=1){cout<<a[i];
break;}
else{cout<<a[i]<<" ";}
i-=1
}

cout<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected ';' before '}' token
   16 | i-=1
      |     ^
      |     ;
   17 | }
      | ~
Language: C++

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


Compiler output:
a.cc:23:9: error: 'a' does not name a type
   23 |         a
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
int n;
cin >> n;
int a[100];
for(int i = 0;i < n;i++) cin >> a[i] ;
for(int j = 0;j < n-1-j;j++) swap(a[j],a[n-1-j]);
for(int k = 0 ;k < n; k++) cout << " " << a[k];
 cout << endl;




Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected '}' at end of input
   11 |  cout << endl;
      |               ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;


int main(){
int n;
cin>>n;

int Z[100];
   for(int i=0;i<n;i++) cin>>Z[i];


   for(int i=0;i<n-1-i;i++) swap(Z[i], Z5[n-1-i]);

   for(int i=0;i<n;i++){
   if(i) cout<<" ";
   cout<<Z[i];
   }
 cout<<endl;

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:40: error: 'Z5' was not declared in this scope; did you mean 'Z'?
   13 |    for(int i=0;i<n-1-i;i++) swap(Z[i], Z5[n-1-i]);
      |                                        ^~
      |                                        Z
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n];
	int i;
	for(i=0;i<n;i++){
	cin>>a[i];}
	int j;
	for(j=n-1;j>=0;j--){
	cout<<" "<<a[cj];}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'cj' was not declared in this scope; did you mean 'j'?
   12 |         cout<<" "<<a[cj];}
      |                      ^~
      |                      j
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=0; i<n; i++){
      |             ^
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         for(i=0; i<n; i++){
      |             ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n,*p,*q;
    cin >> n;
    p = new int [n];
    q = new int [n];
    for (int i = 0; i < n; i++){
        cin >> p[i];
    }
    for (int i = 0; i < n; i++){
        q[n-1-i] = p[i];
    }
    for (int i = 0; i < n; i++){
        cout << q[i];
        if(i != (n-1)){
            cout << " ";
        }
    }
    delete [] p;


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: expected '}' at end of input
   21 |     delete [] p;
      |                 ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n, a[100];
  cin >> n;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
  }
  for(int k = n - 1; k > -1; --k){
    cout << a[k];
    if( k == 0) break;
    cour << " ";
  }
  cout << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'cour' was not declared in this scope
   13 |     cour << " ";
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin>>n;

  int a[1000];
  for(int i=0;i<n;i++) cin>>a[a];
  
    
  for(int i=0;i < n-1-i;i++) swap(a[i], a[n-1-i]);

  for(int i=0;i<n;i++){
    if(i) cout<<" ";
    cout<<a[i];
  }
  cout<<endl;

  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:9:30: error: invalid types 'int [1000][int [1000]]' for array subscript
    9 |   for(int i=0;i<n;i++) cin>>a[a];
      |                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n,a[100];
	cin>>n;
	for(int i=n-1;i>=0;i--){
		cin>>a[i];
	}
	for(int j=0;j<n;j++){
		cout<<a[j]<<' ';S
	}
	cout<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:33: error: 'S' was not declared in this scope
   11 |                 cout<<a[j]<<' ';S
      |                                 ^
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: expected ';' before 'for'
   10 | i=n
      |    ^
      |    ;
   11 |                 for(;;){
      |                 ~~~
a.cc:11:23: error: expected primary-expression before ')' token
   11 |                 for(;;){
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
   int n;
   cin >> n;
   int a[100]
   for(int i=0;i<n;i++) cin>>a[i];

   for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
   for(int i=0;i<n;i++){
      if(i) cout<<" ";
      cout<<a[i];
   }
   cout<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: expected initializer before 'for'
    8 |    for(int i=0;i<n;i++) cin>>a[i];
      |    ^~~
a.cc:8:16: error: 'i' was not declared in this scope
    8 |    for(int i=0;i<n;i++) cin>>a[i];
      |                ^
a.cc:10:34: error: 'a' was not declared in this scope
   10 |    for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
      |                                  ^
a.cc:13:13: error: 'a' was not declared in this scope
   13 |       cout<<a[i];
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
   int n;
   cin >> n;
   
   int a[100]
   for(int i=0;i<n;i++) cin>>a[i];

   for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
   
   for(int i=0;i<n;i++){
      if(i) cout<<" ";
      cout<<a[i];
   }
   cout<<endl;
   
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: expected initializer before 'for'
    9 |    for(int i=0;i<n;i++) cin>>a[i];
      |    ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 |    for(int i=0;i<n;i++) cin>>a[i];
      |                ^
a.cc:11:34: error: 'a' was not declared in this scope
   11 |    for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1-i]);
      |                                  ^
a.cc:15:13: error: 'a' was not declared in this scope
   15 |       cout<<a[i];
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
   int n;
   cin >> n;
   int a[100]
   for(int i=0;i<n;i++) cin>>a[i];

   for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1]);
   for(int i=0;i<n;i++){
      if(i) cout<<" ";
      cout<<a[i];
   }
   cout<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: expected initializer before 'for'
    8 |    for(int i=0;i<n;i++) cin>>a[i];
      |    ^~~
a.cc:8:16: error: 'i' was not declared in this scope
    8 |    for(int i=0;i<n;i++) cin>>a[i];
      |                ^
a.cc:10:34: error: 'a' was not declared in this scope
   10 |    for(int i=0;i<n-1-i;i++) swap(a[i],a[n-1]);
      |                                  ^
a.cc:13:13: error: 'a' was not declared in this scope
   13 |       cout<<a[i];
      |             ^
Language: C++

#include<iostream>
using namespace std;
void main(){
	int n;
	int a[100];
cin>>n;
	for(int i=0;i<n;i++)
	cin>>a[i];
	for(int j=n-1;j>=0;j--){
		if(j!=0)
	cout<<a[j]<<' ';
		else cout<<a[j]<<endl;
	} 
	
}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
void  main(){
	int n;
	int a[100];
cin>>n;
	for(int i=0;i<n;i++)
	cin>>a[i];
	for(int j=n-1;j>=0;j--){
		if(j!=0)
	cout<<a[j]<<' ';
		else cout<<a[j]<<endl;
	} 
	return 0;
}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void  main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,x=0,y;
cin >>n;
n--;
int a[n];
n++;
for(int i=1;i<=n;i++){
cin >> a[n];
}
n--;
for (i=0;i<=n;i++){
if(x<= a[i]){
x=a[i];
y=i;
}
cout<<x<<" ";
a[i]=0;

}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:6: error: 'i' was not declared in this scope
   13 | for (i=0;i<=n;i++){
      |      ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,x=0,y;
cin >>n;
n--;
int a[n];
n++;
for(int i=1;i<=n;i++){
cin >> a[n];
}
n--;
for (i=0;i<=n;i++){
if(x<= a[i]){
x=a[i];
y=i;
}
cout<<x<<" ";
a[i]=0;

}

}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:6: error: 'i' was not declared in this scope
   13 | for (i=0;i<=n;i++){
      |      ^
a.cc: At global scope:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^