criyle/codenet-compile-errors huggingface dataset:
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 |                 }
      |                 ~                
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
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--){
		cout << a[i] << " \n"[i == 0];

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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 = n - 1;i >= 0;i--) {
		printf("%d", a[i]);
		if (i != 0) {
			printf(" ");
		}
	delete[]a;
}


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 <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int a;
    
    stack<int> s;
    for (int i = 0; i < n; i++) {
        cin >> a;
        s.push(a);
    }
    
    for (int i = 0; i < n; i++) {
        cout << s.front() << " ";
        s.pop();
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'class std::stack<int>' has no member named 'front'
   16 |         cout << s.front() << " ";
      |                   ^~~~~
Language: C++

#include<iostream>
using namespace std;

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


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

include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    
    for(int i = 0; i < n ; i++){
        cout << a[i];
        cout << "";
    }
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n;
      |     ^~~
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << a[i];
      |         ^~~~
Language: C++

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

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

int main(){
    int n; cin >> n;
    vector<int> a(n);REP(i, n) cin >> a[i];
    REP(i, n){
        printf(a[n-1-i]);
        if(i != n - 1) printf(' ');
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const char*' [-fpermissive]
   10 |         printf(a[n-1-i]);
      |         ~~~~~~^~~~~~~~~~
      |               |
      |               __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:11:31: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   11 |         if(i != n - 1) printf(' ');
      |                               ^~~
      |                               |
      |                               char
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>

int main()
{
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i)<<endl;
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> vec(n);
      |            ^~~
a.cc:8:19: error: 'n' was not declared in this scope
    8 |     for(int i=0;i<n;++i){
      |                   ^
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin>>vec.at(i);
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:14: error: 'vec' was not declared in this scope
    9 |         cin>>vec.at(i);
      |              ^~~
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> vec2(n);
      |            ^~~
a.cc:12:5: error: 'vec2' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:12:13: error: 'i' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:12:16: error: 'vec' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:12:23: error: 'n' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |                       ^
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |             cout<<vec2.at(i)<<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:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |             cout<<vec2.at(i)<<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++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>

int main()
{
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i)<<endl;
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/





Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> vec(n);
      |            ^~~
a.cc:8:19: error: 'n' was not declared in this scope
    8 |     for(int i=0;i<n;++i){
      |                   ^
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin>>vec.at(i);
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:14: error: 'vec' was not declared in this scope
    9 |         cin>>vec.at(i);
      |              ^~~
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> vec2(n);
      |            ^~~
a.cc:12:5: error: 'vec2' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:12:13: error: 'i' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:12:16: error: 'vec' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:12:23: error: 'n' was not declared in this scope
   12 |     vec2.at(i)=vec.at(n-i+1);
      |                       ^
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |             cout<<vec2.at(i)<<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:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |             cout<<vec2.at(i)<<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++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>

int main()
{
    cin>>n;
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i)<<endl;
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin>>n;
      |     ^~~
      |     std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec(n);
      |            ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> vec2(n);
      |            ^~~
a.cc:13:5: error: 'vec2' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:13:13: error: 'i' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:13:16: error: 'vec' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:15:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |             cout<<vec2.at(i)<<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:15:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |             cout<<vec2.at(i)<<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++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    cin>>n;
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i);
            if(i!=0){cout<<" "}
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec(n);
      |            ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> vec2(n);
      |            ^~~
a.cc:13:5: error: 'vec2' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:13:13: error: 'i' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:13:16: error: 'vec' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:16:31: error: expected ';' before '}' token
   16 |             if(i!=0){cout<<" "}
      |                               ^
      |                               ;
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    cin>>n;
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i);
            if(i!=0){cout<<" "};
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec(n);
      |            ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> vec2(n);
      |            ^~~
a.cc:13:5: error: 'vec2' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:13:13: error: 'i' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:13:16: error: 'vec' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:16:31: error: expected ';' before '}' token
   16 |             if(i!=0){cout<<" "};
      |                               ^
      |                               ;
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{   int n;
    cin>>n;
    vector<int> vec(n);
    for(int i=0;i<n;++i){
        cin>>vec.at(i);
    }
    vector<int> vec2(n);
    vec2.at(i)=vec.at(n-i+1);
        for(int i=0;i<n;++i){
            cout<<vec2.at(i);
            if(i!=0){cout<<" "};
        }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec(n);
      |            ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> vec2(n);
      |            ^~~
a.cc:13:5: error: 'vec2' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |     ^~~~
a.cc:13:13: error: 'i' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |             ^
a.cc:13:16: error: 'vec' was not declared in this scope
   13 |     vec2.at(i)=vec.at(n-i+1);
      |                ^~~
a.cc:16:31: error: expected ';' before '}' token
   16 |             if(i!=0){cout<<" "};
      |                               ^
      |                               ;
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
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());
 cout<<a.at(0);
 for(int i=1;i<n;++i){
 cout<<" "<<a.at(i);
     
 }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:10:14: error: 'a' was not declared in this scope
   10 |         cin>>a.at(i);
      |              ^
a.cc:12:13: error: 'a' was not declared in this scope
   12 |     reverse(a.begin(),a.end());
      |             ^
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(a.begin(),a.end());
      |     ^~~~~~~
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
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());
 cout<<a.at(0);
 for(int i=1;i<n;++i){
 cout<<" "<<a.at(i)<<endl;
     
 }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/




Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:10:14: error: 'a' was not declared in this scope
   10 |         cin>>a.at(i);
      |              ^
a.cc:12:13: error: 'a' was not declared in this scope
   12 |     reverse(a.begin(),a.end());
      |             ^
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(a.begin(),a.end());
      |     ^~~~~~~
Language: C++

#include <stdio.h>

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



Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected ';' before 'printf'
   12 |     if( j ) printf(" ")
      |                        ^
      |                        ;
   13 |     printf("%d",retsu[j]);
      |     ~~~~~~              
a.cc: At global scope:
a.cc:17:3: error: expected unqualified-id before 'return'
   17 |   return 0;
      |   ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include <stdio.h>

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



Compiler output:
a.cc:17:3: error: expected unqualified-id before 'return'
   17 |   return 0;
      |   ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'x' was not declared in this scope
   12 |     cout << " " << a[x] << endl;
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    string str;
    cin >> str;
    transform(str.begin(),str.end(),str.begin(),::tolower);
        
    int count=0;
    while(1){
        string tmp;
        cin>>tmp;
        if(tmp=="END_OF_TEXT") break;
        transform(tmp.begin(),tmp.end(),tmp.begin(),::tolower);
        if(str==tmp) count++;
    }
    cout <<count<<endl;
       


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

#inclide<iosream>
using namespace std;
int main(){
    bool cards[4][14];
    int n,rank;
    char suit;
    
    for(int s = 0;s<4;s++)
        for(int r = 0;r<=13;r++)
            cards[s][r] = 0;
        
    cin >> n;
    for(int i = 0;i < n ; i++){
        cin >> suit >> rank;
        if(suit =='S')cards[0][rank] = 1;
        if(suit =='H')cards[0][rank] = 1;
        if(suit =='C')cards[0][rank] = 1;
        if(suit =='D')cards[0][rank] = 1;
    }
    
    for(int s = 0;i < n;s++){
        for(int r = 1;r <= 13;r++){
            if(cards[s][r]) continue;
            if(s == 0) suit = 'S';
            if(s == 1) suit = 'H';
            if(s == 2) suit = 'C';
            if(s == 3) suit = 'D';
            count << suit << " " << r << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclide; did you mean #include?
    1 | #inclide<iosream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclide<iosream>
a.cc:21:19: error: 'i' was not declared in this scope
   21 |     for(int s = 0;i < n;s++){
      |                   ^
a.cc:28:13: error: 'count' was not declared in this scope
   28 |             count << suit << " " << r << endl;
      |             ^~~~~
a.cc:28:42: error: 'endl' was not declared in this scope
   28 |             count << suit << " " << r << endl;
      |                                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclide<iosream>
Language: C++

#include<iosream>
using namespace std;
int main(){
    bool cards[4][14];
    int n,rank;
    char suit;
    
    for(int s = 0;s<4;s++)
        for(int r = 0;r<=13;r++)
            cards[s][r] = 0;
        
    cin >> n;
    for(int i = 0;i < n ; i++){
        cin >> suit >> rank;
        if(suit =='S')cards[0][rank] = 1;
        if(suit =='H')cards[0][rank] = 1;
        if(suit =='C')cards[0][rank] = 1;
        if(suit =='D')cards[0][rank] = 1;
    }
    
    for(int s = 0;i < n;s++){
        for(int r = 1;r <= 13;r++){
            if(cards[s][r]) continue;
            if(s == 0) suit = 'S';
            if(s == 1) suit = 'H';
            if(s == 2) suit = 'C';
            if(s == 3) suit = 'D';
            count << suit << " " << r << endl;
        }
    }
    return 0;
}


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

#include<iostream>
using namespace std;
int main(){
    bool cards[4][14];
    int n,rank;
    char suit;
    
    for(int s = 0;s<4;s++)
        for(int r = 0;r<=13;r++)
            cards[s][r] = 0;
        
    cin >> n;
    for(int i = 0;i < n ; i++){
        cin >> suit >> rank;
        if(suit =='S')cards[0][rank] = 1;
        if(suit =='H')cards[0][rank] = 1;
        if(suit =='C')cards[0][rank] = 1;
        if(suit =='D')cards[0][rank] = 1;
    }
    
    for(int s = 0;i < n;s++){
        for(int r = 1;r <= 13;r++){
            if(cards[s][r]) continue;
            if(s == 0) suit = 'S';
            if(s == 1) suit = 'H';
            if(s == 2) suit = 'C';
            if(s == 3) suit = 'D';
            count << suit << " " << r << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'i' was not declared in this scope
   21 |     for(int s = 0;i < n;s++){
      |                   ^
a.cc:28:13: error: 'count' was not declared in this scope
   28 |             count << suit << " " << r << endl;
      |             ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    bool cards[4][14];
    int n,rank;
    char suit;
    
    for(int s = 0;s<4;s++)
        for(int r = 0;r<=13;r++)
            cards[s][r] = 0;
        
    cin >> n;
    for(int i = 0;i < n ; i++){
        cin >> suit >> rank;
        if(suit =='S')cards[0][rank] = 1;
        if(suit =='H')cards[0][rank] = 1;
        if(suit =='C')cards[0][rank] = 1;
        if(suit =='D')cards[0][rank] = 1;
    }
    
    for(int s = 0;s < n;s++){
        for(int r = 1;r <= 13;r++){
            if(cards[s][r]) continue;
            if(s == 0) suit = 'S';
            if(s == 1) suit = 'H';
            if(s == 2) suit = 'C';
            if(s == 3) suit = 'D';
            count << suit << " " << r << endl;
        }
    }
    return 0;
}


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

#include <bits/stdc++.h>
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=o; 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:13:16: error: 'o' was not declared in this scope
   13 |     for( int i=o; i< n-1-i; i++) swap(a[i],a[n-1-i]);
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a[100],n;
	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){
			cout << " ";
		} else {
			cout << endl;
		}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected '}' at end of input
   17 |                 }
      |                  ^
a.cc:11:39: note: to match this '{'
   11 |         for (int i = n-1; i >= 0; i--){
      |                                       ^
a.cc:17:18: error: expected '}' at end of input
   17 |                 }
      |                  ^
a.cc:4:12: 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];
    }
    return 0;
}
         


Compiler output:
a.cc:2:7: error: extended character 　 is not valid in an identifier
    2 | using namespace　std;
      |       ^
a.cc:2:7: error: expected nested-name-specifier before 'namespace\U00003000std'
    2 | using namespace　std;
      |       ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: 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:11:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         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:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |         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
      |                  ^~~~
Language: C++

#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
    size_t n;
    int *ptr, *a, i;
    cin >> n;
    ptr = (int *) calloc(n, sizeof(int))
    if (ptr == NULL)
        exit(EXIT FAILURE);
    for(i = 1; i <= n; i++) {
        cin >> *a;
        a++;
    }
    for(i = n; i >= 1; i--) {
        cout << *(a + i-1) << " ";
    }
    cout << "\b\n"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: expected ';' before 'if'
   10 |     ptr = (int *) calloc(n, sizeof(int))
      |                                         ^
      |                                         ;
   11 |     if (ptr == NULL)
      |     ~~                                   
a.cc:20:19: error: expected ';' before '}' token
   20 |     cout << "\b\n"
      |                   ^
      |                   ;
   21 | }
      | ~
Language: C++

#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
    size_t n;
    int *ptr, *a, i;
    cin >> n;
    ptr = (int *) calloc(n, sizeof(int));
    if (ptr == NULL)
        exit(EXIT FAILURE);
    for(i = 1; i <= n; i++) {
        cin >> *a;
        a++;
    }
    for(i = n; i >= 1; i--) {
        cout << *(a + i-1) << " ";
    }
    cout << "\b\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'EXIT' was not declared in this scope
   12 |         exit(EXIT FAILURE);
      |              ^~~~
Language: C++

#include <iostream>
#include <stdlib.h>

using namespace std;

int main() {
	size_t n;
	int *ptr, *a, i;
	cin >> n;
	ptr = (int *)calloc(n, sizeof(int));
	if (ptr == NULL)
		exit(EXIT_FAILURE);
	a = ptr;
	for (i = 1; i <= (int)n; i++) {
		cin >> *(a + i - 1);
	for (i = (int)n; i >= 1; i--) {
		cout << *(a + i - 1) << " ";
	}
	cout << "\b\n";
}

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

#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	int n, 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] << " ";
	}

	cout << endl;

	return 0;
}

Compiler output:
a.cc:4:22: error: '_TCHAR' has not been declared
    4 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin >>n;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include <iostream>
a.cc:11:1: error: 'cout' was not declared in this scope
   11 | cout << a[n-1-i] << " " ;
      | ^~~~
a.cc:11:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:1: error: 'cout' was not declared in this scope
   13 | cout << a[0];
      | ^~~~
a.cc:13:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;
int main(){

  int n;
  cin >>n;
 
  int *arry = new int[n];

  for(int i=0; i<n; i++){
      cin >> *(arry+i);
  }
  
  for(i=n-1; i>0; i--){
      cout << *(arry+i) << " ";
  }
  cout << *(arry) << endl;

  delete[] arry;
  return 0;
}

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

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

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

//reverse numbers

#include<iostream>
using namespace std;

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

cin>>n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: expected ';' before ')' token
   13 | for(int i = 0; i < n, i++)
      |                          ^
      |                          ;
a.cc:15:8: error: expected primary-expression before 'int'
   15 | cin >> int[i];
      |        ^~~
a.cc:19:9: error: expected primary-expression before 'int'
   19 | cout << int[n-j] <<" " <<endl;
      |         ^~~
Language: C++

//reverse numbers

#include<iostream>
using namespace std;

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

cin>>n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected primary-expression before 'int'
   15 | cin >> int[i];
      |        ^~~
a.cc:19:9: error: expected primary-expression before 'int'
   19 | cout << int[n-j] <<" " <<endl;
      |         ^~~
Language: C++

//reverse numbers

#include<iostream>
using namespace std;

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

cin>>n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected primary-expression before 'int'
   15 | cin >> int a[i];
      |        ^~~
a.cc:19:9: error: expected primary-expression before 'int'
   19 | cout << int a[n-j] <<" " <<endl;
      |         ^~~
Language: C++

//reverse numbers

#include<iostream>
using namespace std;

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

cin >> n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected primary-expression before 'int'
   15 | cin >> int a[i];
      |        ^~~
a.cc:19:9: error: expected primary-expression before 'int'
   19 | cout << int a[n-j] <<" " <<endl;
      |         ^~~
Language: C++

#include<stdio.h>

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

  scanf("%d",&a);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected '}' before 'else'
   15 |     else{
      |     ^~~~
a.cc:13:20: note: to match this '{'
   13 |     if(j>0&&j<=a-1){
      |                    ^
Language: C++

#include<iostream>
using namespace std;

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before 'j'
   12 |         for(int j = 5; j >= 0 j--){
      |                              ^~
      |                              ;
Language: C++

$stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"

Compiler output:
a.cc:1:1: error: '$stdin' does not name a type
    1 | $stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"
      | ^~~~~~
a.cc:1:25: error: 'array' does not name a type
    1 | $stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"
      |                         ^~~~~
a.cc:1:63: error: 'print' does not name a type; did you mean 'int'?
    1 | $stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"
      |                                                               ^~~~~
      |                                                               int
a.cc:1:82: error: 'array' does not name a type
    1 | $stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"
      |                                                                                  ^~~~~
a.cc:1:120: error: 'print' does not name a type; did you mean 'int'?
    1 | $stdin.gets.chomp.to_i; array = $stdin.gets.chomp.split(/ /); print array.shift; array.reverse.each{|i| print " ", i}; print "\n"
      |                                                                                                                        ^~~~~
      |                                                                                                                        int
Language: C++

#include <iostream>

int main(){
	int size;
	int array[];
	std::cin>>size;
	array=new int[size];
	for(int i=0;i<size;i++){
		std::cin>>array[i];
	}
	for(int i=size-1;i>=0;i--){
		std::cout<<array[i]<<(i?" ":"");
	}
	return 0;
}

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

#include<iostream>
using namespace std;

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

cout hoge[n] = { };

int sum = 0 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ';' before 'hoge'
    8 | cout hoge[n] = { };
      |     ^~~~~
      |     ;
a.cc:10:12: error: expected ',' or ';' at end of input
   10 | int sum = 0
      |            ^
a.cc:10:12: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n,in;
    vector<int> v;

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> in;
        v.push_back(in);
    }
    reverse(v.begin(), v.end());

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

    return 0;
}

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

#include<iostrea>
using namespace std;

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

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'i' was not declared in this scope
   12 |       cout << " " << x[i - 1 - j];
      |                        ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n, a ;
	cin >> n;
	int day[n];
	for(int i = 0; i < n; i++){
		cin >> a;
		day[i] = a;
	}
	for(int i = 0; i < n; i++){
		int b = n - i - 1;
		printf("%d", day[b]);
		printf(" ")
	}
	return 0;
	 }
	

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ';' before '}' token
   15 |                 printf(" ")
      |                            ^
      |                            ;
   16 |         }
      |         ~
Language: C++

#include <iostream>

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) cout << " ";
    cout << a[n-1-i]; // 99????????????????????????
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: 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:17:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     if (i) 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:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout << a[n-1-i]; // 99????????????????????????
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   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:20:11: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   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>
using namespace std;
int kazu[100],n;
int com(){
cin>>n;
for(int a=0;a<n;a++)
cin>>kazu[a];
for(int b=0;b<n;b++){
cout<<kazu[a];
if(b!=n-1)
cout<<" ";
else
cout<<endl;
}
}
int main(){
com();
return 0;
}

Compiler output:
a.cc: In function 'int com()':
a.cc:9:12: error: 'a' was not declared in this scope
    9 | cout<<kazu[a];
      |            ^
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int kazu[100],n;
int com(){
cin>>n;
for(int a=0;a<n;a++)
cin>>kazu[a];
for(int b=n-1;b>=0;b--){
cout<<kazu[a];
if(b!=0)
cout<<" ";
else
cout<<endl;
}
}
int main(){
com();
return 0;
}

Compiler output:
a.cc: In function 'int com()':
a.cc:9:12: error: 'a' was not declared in this scope
    9 | cout<<kazu[a];
      |            ^
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

// 配列を用意し、インデックス0から順番に入力した値を入れていく
// 逆順に出力していく。

int main(){
    int n;
    int array[100]
    cin >> n;
    
    for (int i = 0; i < n; ++i) {
        cin >> array[i];
    }
    for (int i = n - 1; i >= 0; --i) {
        cout << i;
        if (i != 0) {
            cout << ' ';
        }
        else {
            cout << endl;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected initializer before 'cin'
   11 |     cin >> n;
      |     ^~~
a.cc:14:21: error: missing template arguments before '[' token
   14 |         cin >> array[i];
      |                     ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ')' before ';' token
    7 | for(int i=0;;i<n;i++){
      |    ~            ^
      |                 )
a.cc:7:18: error: 'i' was not declared in this scope
    7 | for(int i=0;;i<n;i++){
      |                  ^