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

#include <iostream>
using namespace std;

int main(){

	int a[11],max1,max2,max3;

	for (int i=1; i<11; i++){
		while (true){ 
		cout << "山の高さ" << i << "（整数）" ;			
		cin >> a[i];
		if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
			break;
		}
		}	
	}

	max1 = a[1];

	for (i=2; i<11; i++){
		if (max1 < a[i]){
			swap (max1,a[i]);
		}
	}
	max2 = a[2];

	for (i=3; i<11; i++){
		if (max2 < a[i]){
			swap (max2,a[i]);
		}
	}
	max3 = a[3];

	for (i=4; i<11; i++){
		if (max3 < a[i]){
			swap (max3,a[i]);
		}
	}


		cout << max1 << endl;
		cout << max2 << endl;
		cout << max3 << endl;
		

return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'i' was not declared in this scope
   20 |         for (i=2; i<11; i++){
      |              ^
a.cc:27:14: error: 'i' was not declared in this scope
   27 |         for (i=3; i<11; i++){
      |              ^
a.cc:34:14: error: 'i' was not declared in this scope
   34 |         for (i=4; i<11; i++){
      |              ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int a[11],max1,max2,max3;
	for (int i=1; i<11; i++){
		while (true){ 
		cout << "山の高さ" << i << "（整数）" ;			
		cin >> a[i];
		if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {	break; }}}
	max1 = a[1];
	for (i=2; i<11; i++){
		if (max1 < a[i]){
			swap (max1,a[i]);
		}}
	max2 = a[2];
	for (i=3; i<11; i++){
		if (max2 < a[i]){
			swap (max2,a[i]);
		}}
	max3 = a[3];
	for (i=4; i<11; i++){
		if (max3 < a[i]){
			swap (max3,a[i]);
		}}
		cout << max1 << endl;
		cout << max2 << endl;
		cout << max3 << endl;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'i' was not declared in this scope
   11 |         for (i=2; i<11; i++){
      |              ^
a.cc:16:14: error: 'i' was not declared in this scope
   16 |         for (i=3; i<11; i++){
      |              ^
a.cc:21:14: error: 'i' was not declared in this scope
   21 |         for (i=4; i<11; i++){
      |              ^
Language: C++

#include <iostream>
using namespace std;

void cswap(int &x, int &y)
{
    int tmp = x;
    x = y;
    y = tmp;
}

int main(void){

	int a[11],max1,max2,max3;

	for (int i=1; i<11; i++){
		while (true){ 
		cout << "山の高さ" << i << "（整数）" ;			
		cin >> a[i];
		if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
			break;
		}
		}	
	}

	max1 = a[1];

	for (i=2; i<11; i++){
		if (max1 < a[i]){
			cswap(max1,a[i]);
		}
	}
	max2 = a[2];

	for (i=3; i<11; i++){
		if (max2 < a[i]){
			cswap(max2,a[i]);
		}
	}
	max3 = a[3];

	for (i=4; i<11; i++){
		if (max3 < a[i]){
			cswap(max3,a[i]);
		}
	}


		cout << max1 << endl;
		cout << max2 << endl;
		cout << max3 << endl;
		

return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: 'i' was not declared in this scope
   27 |         for (i=2; i<11; i++){
      |              ^
a.cc:34:14: error: 'i' was not declared in this scope
   34 |         for (i=3; i<11; i++){
      |              ^
a.cc:41:14: error: 'i' was not declared in this scope
   41 |         for (i=4; i<11; i++){
      |              ^
Language: C++

#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>

using namespace std;

int main(){
	int hills[10];
    
    for(int i=0;i<10;i++)cin >> hills[i];
    
	partial_sort( hills, hills + 3, hills+10, greater<int>() );
    
    for(int i=0;i<3;i++)　cout << hills[i] <<endl;
    
	return 0;
}

Compiler output:
a.cc:15:25: error: extended character 　 is not valid in an identifier
   15 |     for(int i=0;i<3;i++)　cout << hills[i] <<endl;
      |                         ^
a.cc: In function 'int main()':
a.cc:15:25: error: '\U00003000cout' was not declared in this scope
   15 |     for(int i=0;i<3;i++)　cout << hills[i] <<endl;
      |                         ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <stringstream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;

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

int main()
{
	int hills[10];
	rep(10) cin>>hills[i];

	sort( hills, hills+9, greater<int>() );

	rep(3) cout<<hills[i]<<endl;

	return 0;
}

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

#include <iostream>
#include <string>
#include <stringstream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<n;++i)
#define rep(n) REP(i,n)
int hills[16];

int main()
{
	rep(10) cin>>hills[i];

	sort( hills, hills+10, greater<int>() );

	rep(3) cout<<hills[i]<<endl;

	return 0;
}

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

#include <iostream>
#include <set>

using namespace std;

int main(void){
	int count = 0;
	set<int, greater<int> > nums;
	for (int i=0; i<10; ++i){
		int num;
		cin >> num;
		nums.insert(num);
	}
	set<int, greater<int> >::iterator it = nums.begin();
	while (it != nums.end() && (n<3)){
		cout << *it << endl;
		++it;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: 'n' was not declared in this scope
   15 |         while (it != nums.end() && (n<3)){
      |                                     ^
Language: C++

using namespace std;

int main(){
	vector <int> v;
	for(int i = 0;i < 10;i++){
		int n;
		cin >> n;
		v.push_back(n);
	}
	sort(v.begin(), v.end());
	//cout << endl;
	for(int i = 9; i >=7;i--){
		cout << v[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector <int> v;
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:4:17: error: expected primary-expression before 'int'
    4 |         vector <int> v;
      |                 ^~~
a.cc:7:17: error: 'cin' was not declared in this scope
    7 |                 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 | using namespace std;
a.cc:8:17: error: 'v' was not declared in this scope
    8 |                 v.push_back(n);
      |                 ^
a.cc:10:14: error: 'v' was not declared in this scope
   10 |         sort(v.begin(), v.end());
      |              ^
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(v.begin(), v.end());
      |         ^~~~
      |         short
a.cc:13:17: error: 'cout' was not declared in this scope
   13 |                 cout << v[i] << endl;
      |                 ^~~~
a.cc:13:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:33: error: 'endl' was not declared in this scope
   13 |                 cout << v[i] << endl;
      |                                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a,a+10);
      |         ^~~~
      |         short
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int a[10];
	
	for(int i=0; i<10; i++){
		cin>>a[i];
	}
	
	int T=0;
	for(int	j=1; j==0; j++;){
		T=0;
		for(int i=0; i<9; i++){
			if(a[i]<a[i+1]){
				int L;
				L=a[i];
				a[i]=a[i+1];
				a[i+1]=L;
				T=1;
			}
		}
		if(T=0) break;
	}
	
	for(int	i=0; i<3; i++){
		cout<<a[i]<<"\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: expected ')' before ';' token
   12 |         for(int j=1; j==0; j++;){
      |            ~                  ^
      |                               )
a.cc:12:32: error: expected primary-expression before ')' token
   12 |         for(int j=1; j==0; j++;){
      |                                ^
Language: C++

#include<iostream>

int main(){

int a[10];


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

for(int i = 0; i < 10; i++){
for(int j = i + 1; j < 10; j++){
if(a[i] > a[j]){
dumy = a[i];
a[i] = a[j];
a[j] = dumy;
}
}
}



for(int k=0;k<10;k++){
cout<<a[0] <<a[1] <<a[2]<<endl;
}



return 0}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin>>a[k]>>endl;
      | ^~~
      | 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:9:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 | cin>>a[k]>>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)
      |     ^~~~
a.cc:15:1: error: 'dumy' was not declared in this scope
   15 | dumy = a[i];
      | ^~~~
a.cc:25:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 | cout<<a[0] <<a[1] <<a[2]<<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:25:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 | cout<<a[0] <<a[1] <<a[2]<<endl;
      |                           ^~~~
      |                           std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:30:9: error: expected ';' before '}' token
   30 | return 0}
      |         ^
      |         ;
Language: C++

arr = []
for cnt in 0...10
  arr.push(gets.chomp.to_i())
end

arr.sort!.reverse!

for cnt in 0...3
  puts(arr[cnt])
end

Compiler output:
a.cc:2:12: error: too many decimal points in number
    2 | for cnt in 0...10
      |            ^~~~~~
a.cc:8:12: error: too many decimal points in number
    8 | for cnt in 0...3
      |            ^~~~~
a.cc:1:1: error: 'arr' does not name a type
    1 | arr = []
      | ^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int i=0;
	int m[10];
	for(i=0;i<10;i++)
	{
		cin>>m[i];
		while(0>m[i]||m[i]>10000)
			cin>>m[i];

	}
	
  sort(m[0], m[9], greater<int>());
	
	cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(m[0], m[9], greater<int>());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(void){

  int mountain[10];

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

  sort( mountain , mountain + 10 );

  cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:55: error: expected primary-expression before '<<' token
   16 |   cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl;
      |                                                       ^~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
	int a=0;
	std::vector<int> vec(10);
	for(int i=0;i<10;i++){
		std::cin>>vec[i];
	}
	/*for(int d=0;d<3;d++){
		for(int i=0;i<10;i++){
			if(vec[i]>a)a=vec[i];
		}
		std::cout<<a<<std::endl;
		for(int i=0;i<10;i++){
			if(vec[i]==a)vec[i]=0;
		}
		a=0;
	}*/
	for(int i=0;i<9;i++){
		if(vec[i]<vec[i+1]){
			a=vec[i];
			vec[i]=vec[i+1];
			vec[i+1]=a;
			a=0;
		}
	}
	std::cout<<vec[0]<<std::endl<<vec[1]<<std::endl<<vec[2]<<std::endl;
	return 0;

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

#include<cstdio>
#include<cstring>

int main(){
    int n[10],a;
    for (int f=0;f<10;f++){
        scanf("%d",&n[f]);
    }
    for(int f1=0;f1<10;f1++){
        for(int f2=0;f2<10;f2++){
            a=max(a,max(n[f1],n[f2]));
           }
      }
    printf("%d",a);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'max' was not declared in this scope
   11 |             a=max(a,max(n[f1],n[f2]));
      |                     ^~~
a.cc:11:15: error: 'max' was not declared in this scope
   11 |             a=max(a,max(n[f1],n[f2]));
      |               ^~~
Language: C++

#include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

include <iostream>

int main(){
	int first=0,second=0,third=0,height;
	for(int i=0;i<10;++i){
		height=get();
		if(height>first){
			second=first;
			first=height;
		}
		else if(height>second){
			third=second;
			second=height;
		}
		else if(height>third){
			third=height;
		}
	}
	std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
Language: C++

#include <iostream>

int main(){
	int first=0,second=0,third=0,height;
	for(int i=0;i<10;++i){
		height=get();
		if(height>first){
			second=first;
			first=height;
		}
		else if(height>second){
			third=second;
			second=height;
		}
		else if(height>third){
			third=height;
		}
	}
	std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'get' was not declared in this scope; did you mean 'std::get'?
    6 |                 height=get();
      |                        ^~~
      |                        std::get
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 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/tuple:2517:5: note: 'std::get' declared here
 2517 |     get(const tuple<_Types...>&& __t) noexcept
      |     ^~~
Language: C++

#include <iostream>

int main(){
	int first=0,second=0,third=0,height;
	for(int i=0;i<10;++i){
		cin>>height;
		if(height>first){
			second=first;
			first=height;
		}
		else if(height>second){
			third=second;
			second=height;
		}
		else if(height>third){
			third=height;
		}
	}
	std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |                 cin>>height;
      |                 ^~~
      |                 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
      |                  ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
    vector<int> height;
    int h;
    while (cin>>h) {
        height.push_back(h);
    }
    sort(height.begin(), height.end());
    for(int i=1;i<=3;i++){
        cout<<height[height.size()-i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(height.begin(), height.end());
      |     ^~~~
      |     short
Language: C++

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

int main(){
    vector <int> v;
int a;    
for(int i-;i<10;i++){
cin >> a;
v.push_back(a);
}

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

cout << v[0] << endl << v[1] << endl << v[2] << endl;

return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before '-' token
    9 | for(int i-;i<10;i++){
      |          ^
      |          ;
a.cc:9:11: error: expected primary-expression before ';' token
    9 | for(int i-;i<10;i++){
      |           ^
a.cc:9:16: error: expected ')' before ';' token
    9 | for(int i-;i<10;i++){
      |    ~           ^
      |                )
a.cc:9:17: error: 'i' was not declared in this scope
    9 | for(int i-;i<10;i++){
      |                 ^
a.cc:14:5: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
   14 | sort(v.begin(),v.end);
      | ~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main(){
    vector <int> v;
    int a;    
    for(int i-;i<10;i++){
        cin >> a;
        v.push_back(a);
    }

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

    cout << v[0] << endl << v[1] << endl << v[2] << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before '-' token
    9 |     for(int i-;i<10;i++){
      |              ^
      |              ;
a.cc:9:15: error: expected primary-expression before ';' token
    9 |     for(int i-;i<10;i++){
      |               ^
a.cc:9:20: error: expected ')' before ';' token
    9 |     for(int i-;i<10;i++){
      |        ~           ^
      |                    )
a.cc:9:21: error: 'i' was not declared in this scope
    9 |     for(int i-;i<10;i++){
      |                     ^
Language: C++

//#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#define M 40000
using namespace std;
 typedef struct yyyy
 {
     int h;
     double s[5],t[5];
 }yyy;

double h;
double l[3],r[3];
const double pi=acos(-1);
double a[205];
yyy p[3][205];
double eps=1e-6;
int n;
typedef struct nnode
{
    double tt;
    int flag;
}node;
node as[200000];
int tim;

  void cjj(int n)
  {
      int i,j;
      for (i=1;i<=n;i++)
      for (j=1;j<=2;j++)
      {
          double k1,k2;
          double a1,a2;
          double si,co;
          double ll,h;
          double v=a[i];
          double k=v*sqrt(v*v+2*9.8*h)/9.8;
          int flag;
          k1=l[j]/k;
          k2=r[j]/k;
          if (k1>1+eps) {p[j][i].h=0;continue;}
          si=l[j]/k;

          co=sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=l[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a1=acos(h/v)*flag;

          co=-sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=l[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a2=acos(h/v)*flag;

          if (a1<a2) swap(a1,a2);

          if (k2>1-eps) {p[j][i].h=1;p[j][i].s[1]=a1;p[j][i].t[1]=a2;continue;}
          else
          {
              p[j][i].h=2;
              p[j][i].s[1]=a1;
              p[j][i].t[2]=a2;
          }

          si=r[j]/k;

          co=sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=r[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a1=acos(h/v)*flag;

          co=-sqrt(1-si*si);
          ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
          h=r[j]*9.8/ll;
          if (ll<sqrt(2*9.8*h)+eps) flag=-1;
          else flag=1;

          a2=acos(h/v)*flag;

          if (a1<a2) swap(a1,a2);

          p[j][i].s[2]=a2;
          p[j][i].t[1]=a1;

      }



  }

int main()
{
        freopen("in.txt","r",stdin);
        //freopen("out.txt","w",stdout);
        int k,kk;
        int i;
        while(~scanf("%d",&n))
        {
            int c,maxx=0;
            if(n==0)break;
            scanf("%lf%lf%lf%lf%lf",&h,&l[1],&r[1],&l[2],&r[2]);
            for(i=1;i<=n;i++)
            scanf("%lf",&a[i]);

            cjj(n);
            tim=0;
            for(i=1;i<=n;i++)
            {
                a[++tim].tt
            }
        }

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:123:26: error: request for member 'tt' in 'a[(++ tim)]', which is of non-class type 'double'
  123 |                 a[++tim].tt
      |                          ^~
Language: C++

#include <iostream>
using namespace std;
int main() {
int a[10];
int b;
for(int i=0;i<10;i++){
cin>>b;
a[i]=b;
}
sort(a,a+10,greater<int>());
cout<<a[0]<<endl;
cout<<a[1]<<endl;
cout<<a[2]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 | sort(a,a+10,greater<int>());
      | ^~~~
      | short
Language: C++

#include<stdio.h>
int main()
{
    long long int  ansh[11],i,n,a=0,b=0,c=0;
    for(i=1;i<=10;i++){
        scanf("%lld",&ansh[i]);
        if(a<=ansh[i]){
            c=b;
            y=a;
            a=ansh[i];
        }
        else if(b<=ansh[i]){
            c=b;
            y=ansh[i];
        }
        else if(z<=ansh[i]){
            c=ansh[i];
        }
    }

    printf("%lld\n%lld\n%lld\n",a,b,c);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'y' was not declared in this scope
    9 |             y=a;
      |             ^
a.cc:14:13: error: 'y' was not declared in this scope
   14 |             y=ansh[i];
      |             ^
a.cc:16:17: error: 'z' was not declared in this scope
   16 |         else if(z<=ansh[i]){
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int a[3],n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:35: error: 'andl' was not declared in this scope
   29 |   cout << a[0] << endl << a[1] << andl << a[2] << endl
      |                                   ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int a[3],n;
 
int main(){
  a[0] = 0;
  a[1] = 0;
  a[2] = 0;
  for(int i = 0; i < 10; i++){
    cin >> n;
    if(a[2] > n){
      break;
    }else{
      if(a[1] > n){
        a[2] = n;
      }else{
        if(a[0] > n){
          a[2] = a[1];
          a[1] = n;
        }else{
          a[2] = a[1];
          a[1] = a[0];
          a[0] = n;
        }
      }
    }
  }
  cout << a[0] << endl << a[1] << andl << a[2] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:35: error: 'andl' was not declared in this scope
   29 |   cout << a[0] << endl << a[1] << andl << a[2] << endl;
      |                                   ^~~~
Language: C++

#include <stdio.h>

const int tall[10] = {
	1819,
	2003,
	876,
	2840,
	1723,
	1673,
	3776,
	2848,
	1592,
	922
};

int main(void)
{
	int sort[3] = {0, 0, 0};
	int i;
	int temp;
	
	for(i = 0; i < 10; i++){
		if(tall[i] > sort[0]){
			sort[2] = sort[1];
			sort[1] = sort[0];
			sort[0] = tall[i];
		}
		else if(tall[i] > sort[1]){
			sort[2] = sort[1];
			sort[1] = tall[i];
		}
		else if(tall[i] > sort[2]){
			sort[2] = tall[i];
		}
	}
	printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
	
	return 0;
	
}

Compiler output:
a.cc:36:18: error: stray '\' in program
   36 |         printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
      |                  ^
a.cc:36:22: error: stray '\' in program
   36 |         printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
      |                      ^
a.cc: In function 'int main()':
a.cc:36:16: error: expected primary-expression before '%' token
   36 |         printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
      |                ^
a.cc:36:17: error: 'd' was not declared in this scope
   36 |         printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
      |                 ^
Language: C++

#include <stdio.h>

int main(void)
{
	int sort[3] = {0, 0, 0};
	int i;
        int temp;
	
	for(i = 0; i < 10; i++){
                scanf("%d", &temp);
		if(tall[i] > sort[0]){
			sort[2] = sort[1];
			sort[1] = sort[0];
			sort[0] = tall[i];
		}
		else if(tall[i] > sort[1]){
			sort[2] = sort[1];
			sort[1] = tall[i];
		}
		else if(tall[i] > sort[2]){
			sort[2] = tall[i];
		}
	}
	printf("%d\n%d\n%d\n", sort[0], sort[1], sort[2]);
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'tall' was not declared in this scope
   11 |                 if(tall[i] > sort[0]){
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int a[] = {1819
,2003
,876
,2840
,1723
,1673
,3776
,2848
,1592
,922};
int ma=0, aa = 0;

for(int j=0;j<3;j++){
for(int i=0;i<10;i++){
if(ma > a[i])
ma = a[i];
aa = i;
}
cout << ma << endl;
a[a] = 0;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: invalid types 'int [10][int [10]]' for array subscript
   23 | a[a] = 0;
      |  ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int a[10] = {1819,2003,876,2840,1723,1673,3776,2848,1592,922};
int ma=0, aa = 0;

for(int j=0;j<3;j++){
for(int i=0;i<10;i++){
if(ma > a[i]){
ma = a[i];
aa = i;
}
}
cout << ma << endl;
a[a] = 0;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: invalid types 'int [10][int [10]]' for array subscript
   16 | a[a] = 0;
      |  ^
Language: C++

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

int a,b=0;
for(int j=0;j<3;j++){
for(i=0;i<10;i++){
if(b<n[i]){
b = n[i];
a = i;
}
}
cout << b;
n[a] = 0;
}

	return 0;
}

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

int main(){
int a[10];
int max = 0;
int max2 = 0;
int max3 = 0;
int i;
int tmp;

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

for(i = 0; i< 10; i++){
if(max < a[i]){
max = a[i];
tmp = i;
}
}


int tmp2;
for(int i = 0; i< 10; i++){
if(max2 < a[i] && tmp != i){

 max2 = a[i];
tmp2 = i;
}
}
for(i = 0; i< 10; i++){
if(max3 < a[i]&& tmp != i&& tmp2 != i) max3 = a[i];
}

std::cout << max<< std::endl;
std::cout << max2<< std::endl;
std::cout << max3<< std::endl;



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'cin' is not a member of 'std'
   10 | std::cin >> a[i];
      |      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:33:6: error: 'cout' is not a member of 'std'
   33 | std::cout << max<< std::endl;
      |      ^~~~
a.cc:33:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:25: error: 'endl' is not a member of 'std'
   33 | std::cout << max<< std::endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
a.cc:34:6: error: 'cout' is not a member of 'std'
   34 | std::cout << max2<< std::endl;
      |      ^~~~
a.cc:34:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:26: error: 'endl' is not a member of 'std'
   34 | std::cout << max2<< std::endl;
      |                          ^~~~
a.cc:34:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:6: error: 'cout' is not a member of 'std'
   35 | std::cout << max3<< std::endl;
      |      ^~~~
a.cc:35:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:26: error: 'endl' is not a member of 'std'
   35 | std::cout << max3<< std::endl;
      |                          ^~~~
a.cc:35:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

int main(){
int a[10];
int max = 0;
int max2 = 0;
int max3 = 0;
int i;
int tmp;

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

for(i = 0; i< 10; i++){
if(max < a[i]){
max = a[i];
tmp = i;
}
}


int tmp2;
for(int i = 0; i< 10; i++){
if(max2 < a[i] && tmp != i){
max2 = a[i];
tmp2 = i;
}
}

for(i = 0; i< 10; i++){
if(max3 < a[i]&& tmp != i&& tmp2 != i) max3 = a[i];
}

std::cout << max<< std::endl;
std::cout << max2<< std::endl;
std::cout << max3<< std::endl;



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'cin' is not a member of 'std'
   10 | std::cin >> a[i];
      |      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:33:6: error: 'cout' is not a member of 'std'
   33 | std::cout << max<< std::endl;
      |      ^~~~
a.cc:33:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:25: error: 'endl' is not a member of 'std'
   33 | std::cout << max<< std::endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
a.cc:34:6: error: 'cout' is not a member of 'std'
   34 | std::cout << max2<< std::endl;
      |      ^~~~
a.cc:34:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:26: error: 'endl' is not a member of 'std'
   34 | std::cout << max2<< std::endl;
      |                          ^~~~
a.cc:34:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:6: error: 'cout' is not a member of 'std'
   35 | std::cout << max3<< std::endl;
      |      ^~~~
a.cc:35:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:26: error: 'endl' is not a member of 'std'
   35 | std::cout << max3<< std::endl;
      |                          ^~~~
a.cc:35:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <istream>
#include <fstream>
#define SIZE 10
#define TOPNUM 3
using namespace std;

int main(){
	ifstream ifs("data.txt");
	if( !ifs ) return 1;
	int height[SIZE],top[TOPNUM+1]={0};
	for( int i=0;i<SIZE;i++ ){
		ifs>>height[i];
		if( height[i]<0||10000<height[i] )
			return 1;
		for( int j=0;j<TOPNUM;j++ ){
			if( height[i]>top[j] ){
				for( int k=TOPNUM;k>j;k-- ){
					top[k]=top[k-1];
				}
				top[j]=height[i];
				break;
			}
		}
	}
	for( int i=0;i<TOPNUM;i++ ){
		cout<<top[i]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'cout' was not declared in this scope
   26 |                 cout<<top[i]<<endl;
      |                 ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <fstream>
  +++ |+#include <iostream>
    3 | #define SIZE 10
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

int main(){
	std::vector<int> o;
	for(int i=1;i<=10;i++)int in=0,o.push_back(in);
	std::sort(o.begin(),o.end());
	std::cout<<o[7]<<std::endl<<o[8]<<std::endl<<o[9]<<std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected initializer before '.' token
    7 |         for(int i=1;i<=10;i++)int in=0,o.push_back(in);
      |                                         ^
Language: C++

#include <iostream>
using namespace std;
#define N 10
int max(int x[], int n)
{
	int i,j;
	j=0;
	for(i=1; i<n; i++)
		if(x[i]<x[j]) j=i;
		return j;
}
void sel_sort(int x[], int n)
{
	int i, j;
	for(i=n; i>1; i--)
		{ j=max(x,i);   int temp=x[j];   x[j]=x[i-1];  x[i-1]=temp; }
	}
void main()
{
	int a[N], i;
	while(cin>>a[0])
	{
	for(i=1; i<N; i++)
		cin>>a[i];
	sel_sort(a, N);
	for(i=0; i<3; i++)
		cout<<a[i]<<endl;
	}
	
}

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

#include <iostream>
using namespace std;
int max(int x[], 10)
{
	int i,j;
	j=0;
	for(i=1; i<n; i++)
		if(x[i]<x[j]) j=i;
		return j;
}
void sel_sort(int x[], 10)
{
	int i, j;
	for(i=10; i>1; i--)
		{ j=max(x,i);   int temp=x[j];   x[j]=x[i-1];  x[i-1]=temp; }
	}
void main()
{
	int a[10], i;
	while(cin>>a[0])
	{
	for(i=1; i<10; i++)
		cin>>a[i];
	sel_sort(a, 10);
	for(i=0; i<3; i++)
		cout<<a[i]<<endl;
	}
	
}

Compiler output:
a.cc:3:18: error: expected identifier before numeric constant
    3 | int max(int x[], 10)
      |                  ^~
a.cc:3:18: error: expected ',' or '...' before numeric constant
a.cc: In function 'int max(int*, int)':
a.cc:7:20: error: 'n' was not declared in this scope
    7 |         for(i=1; i<n; i++)
      |                    ^
a.cc: At global scope:
a.cc:11:24: error: expected identifier before numeric constant
   11 | void sel_sort(int x[], 10)
      |                        ^~
a.cc:11:24: error: expected ',' or '...' before numeric constant
a.cc:17:1: error: '::main' must return 'int'
   17 | void main()
      | ^~~~
Language: C++

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

int hills[10] ;
int tops[3] = {0,0,0} ;

int main()
{
	for( int i = 0 ; i < 10 ; i ++ )
	{
		cin >> hills[i] ;

		if( hills[i] >= tops[0] )
		{
			tops[2] = tops[1] ;
			tops[1] = tops[0] ;
			tops[0] = hills[i] ;
		}
		else if( hills[i] >= tops[1] )
		{
			tops[2] = tops[1] ;
			tops[1] = hills[i] ;
		}
		else if( hills[i] >= tops[2] )
		{
			tops[2] = hills[i] ;
		}
	}

	for( int i = 0 ; i < 3 ; i ++ )
	{
		cout << tops[i] << "\n" ;
	}

	_getch() ;
	return 0 ;
}

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

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

int main()
{
	vector<int> heights;
	for (int i = 0; i < 10; i++) {
		int height;
		cin >> height;
		heights.push_back(height);
	}
	sort(heights.rbegin(), heights.rend());
	for (int i = 0; i < 3; i++) {
		cout << heights[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |         sort(heights.rbegin(), heights.rend());
      |         ^~~~
      |         short
Language: C++

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

int main()
{
priority_queue<int> que;
for(int i=0;i<10;i++)
{
int t;
cin>>t;
que.push_pack(t);
}
for(int i=0;i<3;i++)
{
cout<<que.top()<<endl;
que.pop();
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_pack'
   12 | que.push_pack(t);
      |     ^~~~~~~~~
Language: C++

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

int main()
{
priority_queue<int> que;
for(int i=0;i<10;i++)
{
int t;
cin>>t;
que.push_back(t);
}
for(int i=0;i<3;i++)
{
cout<<que.top()<<endl;
que.pop();
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_back'
   12 | que.push_back(t);
      |     ^~~~~~~~~
Language: C++

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

int main(){
  vector<int> a ;
  int x;
  for(int i=0;i<10;i++){
    cin >> x
      a.push_back(x);
  }
  sort(a.begin() ,a.end(),greater<int>);
  for(int i=0;i<3;i++){
    cout << a[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'a'
   10 |     cin >> x
      |             ^
      |             ;
   11 |       a.push_back(x);
      |       ~      
a.cc:13:39: error: expected primary-expression before ')' token
   13 |   sort(a.begin() ,a.end(),greater<int>);
      |                                       ^
Language: C++

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

int main(){
  vector<int> a;
  int x;
  for(int i=0;i<10;i++){
    cin >> x
      a.push_back(x);
  }
  sort(a.begin() ,a.end(),greater<int>());
  for(int i=0;i<3;i++){
    cout << a[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'a'
   10 |     cin >> x
      |             ^
      |             ;
   11 |       a.push_back(x);
      |       ~
Language: C++

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

int main_test()
{
	string str;
	cout << "あなたの名前を入力してください" << endl;
	cin >> str;
	cout << str <<"さんよろ"<<endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>#include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}

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

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

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

#include<stdio.h> #include<algorithm> int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}

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

#include<stdio.h> #include<algorithm> using namespace std; int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
    7 |     scanf("%d" &a[i]);
      |           ~~~~ ^~~~~
      |           |        |
      |           |        int
      |           const char [3]
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
    7 |     scanf("%d" &a[i]);
      |           ~~~~ ^~~~~
      |           |        |
      |           |        int
      |           const char [3]
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
itn data[10];

int main(){
for(int i=0;i<10;i++)cin>>data[i];
sort(data,data+10);

for(int i=0;i<3;i++)cout<<data[i]<<endl;

}

Compiler output:
a.cc:4:1: error: 'itn' does not name a type; did you mean 'int'?
    4 | itn data[10];
      | ^~~
      | int
a.cc: In function 'int main()':
a.cc:7:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    7 | for(int i=0;i<10;i++)cin>>data[i];
      |                               ^
a.cc:8:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
    8 | sort(data,data+10);
      |           ~~~~^~~
a.cc:10:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   10 | for(int i=0;i<3;i++)cout<<data[i]<<endl;
      |                               ^
Language: C++

#include <iostream>

using namespace std;

int main(int argc, const char * argv[])
{
    int height[10];
    for (int i=0; i<10; i++) {
        cin >> height[i];
    }
    sort(height, height+10, greater<int>());
    
    for (int i=0; i<3; i++) {
        cout << height[i] << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(height, height+10, greater<int>());
      |     ^~~~
      |     short
Language: C++

#include<iostream>
using namespace std;

int main(){
    int top3Mountain[3];
    memset(top3Mountain, 0, sizeof(top3Mountain));
    
    for (int i=0; i<10; i++) {
        int newHeight = 0;
        scanf("%d", &newHeight);
        
        if (top3Mountain[0] < newHeight) {
            top3Mountain[2] = top3Mountain[1];
            top3Mountain[1] = top3Mountain[0];
            top3Mountain[0] = newHeight;
        } else if (top3Mountain[1] < newHeight) {
            top3Mountain[2] = top3Mountain[1];
            top3Mountain[1] = newHeight;
        } else if (top3Mountain[2] < newHeight) {
            top3Mountain[2] = newHeight;
        }
    }
    
    for (int i=0; i<3; i++) {
        printf("%d\n", top3Mountain[i]);
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'memset' was not declared in this scope
    6 |     memset(top3Mountain, 0, sizeof(top3Mountain));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
using namespace std;
int main(){
        vector<int>ar(10);
        for(auto&e:ar){
                scanf("%d",&e);
        }
        sort(ar.begin(),ar.end());
        printf("%d\n%d\n%d\n",ar[9],ar[8],ar[7]);
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   12 |         sort(ar.begin(),ar.end());
      |         ^~~~
      |         sqrt
Language: C++

#include<iostream>
using namespace std;
int main()
{
   int d[10],i,j,tmp;
   for(i=0;i<10;i++)
        cin >> d[10]; 
   for(i=0;i<9;i++)
     {
        for(l=i+1;j<10;j++)
          { 
             if(d[i]<d[j])
                {
                   tmp=d[i];
                   d[i]=d[j];
                   d[j]=tmp;
                }
           }
     }
    for(i=0;i<3;i++)
       cout << d[i] <<endl;
    return 0;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'l' was not declared in this scope
   10 |         for(l=i+1;j<10;j++)
      |             ^