Language: C++

#include<iostream>
using namespace std;

const int size=999;
int main()
{
	int m,list1[size],list2[size];
	cin>>m;
	for(int j=0;;j++)
	{
		cin>>list1[j];
		if(getchar()=='\n')
			break;
	}
	for (int q=0;q<j+1;q++)
		list2[q]=list1[q];
	for (int a=1;a<m+1;a++)
	{
		for (int w=0;w<a;w++)
			list1[w]=list2[a-1-w];
		for(int e=0;e<a;e++)
		    list2[e]=list1[e];
	}
	for (int k=0;k<j+1;k++)
		cout<<list1[k]<<" ";
	cout<<endl;
	system("pause");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: reference to 'size' is ambiguous
    7 |         int m,list1[size],list2[size];
      |                     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:11: note:                 'const int size'
    4 | const int size=999;
      |           ^~~~
a.cc:7:33: error: reference to 'size' is ambiguous
    7 |         int m,list1[size],list2[size];
      |                                 ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:11: note:                 'const int size'
    4 | const int size=999;
      |           ^~~~
a.cc:11:22: error: 'list1' was not declared in this scope
   11 |                 cin>>list1[j];
      |                      ^~~~~
a.cc:15:24: error: 'j' was not declared in this scope
   15 |         for (int q=0;q<j+1;q++)
      |                        ^
a.cc:16:17: error: 'list2' was not declared in this scope
   16 |                 list2[q]=list1[q];
      |                 ^~~~~
a.cc:16:26: error: 'list1' was not declared in this scope
   16 |                 list2[q]=list1[q];
      |                          ^~~~~
a.cc:20:25: error: 'list1' was not declared in this scope
   20 |                         list1[w]=list2[a-1-w];
      |                         ^~~~~
a.cc:20:34: error: 'list2' was not declared in this scope
   20 |                         list1[w]=list2[a-1-w];
      |                                  ^~~~~
a.cc:22:21: error: 'list2' was not declared in this scope
   22 |                     list2[e]=list1[e];
      |                     ^~~~~
a.cc:22:30: error: 'list1' was not declared in this scope
   22 |                     list2[e]=list1[e];
      |                              ^~~~~
a.cc:24:24: error: 'j' was not declared in this scope
   24 |         for (int k=0;k<j+1;k++)
      |                        ^
a.cc:25:23: error: 'list1' was not declared in this scope
   25 |                 cout<<list1[k]<<" ";
      |                       ^~~~~