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

#include <iostream>
using namespace std;

int main() {
  int hill[10];
  for(int i=0;i < 10;i++) {
    cin >> hill[i];
  }
  sort(hill,hill + 10);
  cout << hill[9] << endl
       << hill[8] << endl
       << hill[7] << endl;
}

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

#include <iostream>
using name space std

int main(){
int hight[10];
int Num;
int naka;
int flag;

for(Num=0;Num!=10;Num++)
{
cin>>hight[Num];
};

for(Num=0;flag!=0;flag=0,Num=0)
{
if(hight[Num]<hight[(Num+1)])
{naka=hight[Num];
hight[Num]=hight[(Num+1)];
hight[(Num+1)]=naka;
flag++;&#160;};
};

cin<<hight[0]<<endl;
cin<<hight[1]<<endl;
cin<<hight[2]<<endl;
return 0;
}

Compiler output:
a.cc:21:9: error: stray '#' in program
   21 | flag++;&#160;};
      |         ^
a.cc:2:7: error: expected nested-name-specifier before 'name'
    2 | using name space std
      |       ^~~~
Language: C++

#include <iostream>

void swap(int *a, int *b);

int main(void)
{
int b[3]={0,0,0};
int i=0;
for(; i < 10; i++){
int s;
scanf("%d",&s);
if(b[2] < s){b[2]=s);}
if(b[1] < b[2]){swap(&b[1],&b[2]);}
if(b[0] < b[1]){swap(&b[0],&b[1]);}
}
std::cout << b[0] << std::endl << b[1] << std::endl << b[2] << std::endl;
return 0;
}

void swap(int *a, int *b){
int c=*a;
*a=*b;*b=c;
return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before ')' token
   12 | if(b[2] < s){b[2]=s);}
      |                    ^
      |                    ;
Language: C++

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

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

#include <iostream>
#include <functional>
#include <list>
using namespace std;

int main(){
	list<int> height_list(10);

	for(int i=0; i<10; ++i){
		int height;
		cin >> height;
		height_list.push_back(height);
	}

	height_list.sort(greater<int>());
	list<int>::iterator ite = height_list.begin();
	for(int i=0; i<3; ++i){
		cout << *ite++ << endl;
	}
	return 0;

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

#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <list>
#include <cmath>
#include <fstream>
#include <queue>
#include <sstream>
#include <algorithm>
#include <cstring>
using namespace std;
emplate <class T> void change(T &a, T &b)// 交&#25442;
{
	T temp;
	temp = a;
	a = b;
	b = temp;
}
template <class T> void quicksort(vector<T> &S,int a,int b) // 快速排序
{
     int x = a;
	 int y = b;
	 T mid = S[(a+b)>>1];
     while (x <= y)
     {
           while (S[x] < mid) x++;
           while (S[y] > mid) y--;
           if (x <= y)
           {
              change(S[x], S[y]);
              x++;
              y--;
           }
     }
     if (x < b) quicksort(S, x, b);
     if (y > a) quicksort(S, a, y);
}
vector<int> vi;
int main()
{
	vi.resize(10);
	for(int i = 0; i < 10; i++)
		cin >> vi[i];
	quicksort(vi,0,9);
	cout << vi[9] << endl;
	cout << vi[8] << endl;
	cout << vi[7] << endl;
	return 0;
}

Compiler output:
a.cc:13:1: error: 'emplate' does not name a type
   13 | emplate <class T> void change(T &a, T &b)// 交&#25442;
      | ^~~~~~~
a.cc: In instantiation of 'void quicksort(std::vector<_Tp>&, int, int) [with T = int]':
a.cc:45:11:   required from here
   45 |         quicksort(vi,0,9);
      |         ~~~~~~~~~^~~~~~~~
a.cc:31:21: error: 'change' was not declared in this scope
   31 |               change(S[x], S[y]);
      |               ~~~~~~^~~~~~~~~~~~
Language: C++

#include <stdio.h>

void main(void)
{

	int a[3] = {0,0,0};
	int b,c;

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

}

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

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

int main(){
    vector<int> heights(10);;
    for(int i = 0; i < 10; ++i){
        cin >> heights[i];
    }
    sort(heights.begin(), heights.end(), greater<int>());

    for(int i = 0; i < 3; ++i){
        cout << heights[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(heights.begin(), heights.end(), greater<int>());
      |     ^~~~
      |     short
Language: C++

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

int main(){
    vector<int> heights(10);;
    for(int i = 0; i < 10; ++i){
        cin >> heights[i];
    }
    sort(heights.begin(), heights.end(), greater<int>());

    for(int i = 0; i < 3; ++i){
        cout << heights[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(heights.begin(), heights.end(), greater<int>());
      |     ^~~~
      |     short
Language: C++

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

int main()
{
	int h[10];
	for (int i = 0; i < 10; ++i) cin >> h[i];
	sort(h, h+10, greater<int>());
	
	cout << h[0] << endl << h[1] << endl << h[2] << endl;
	
	return 0;
	
}

Compiler output:
a.cc:3:21: error: missing terminating > character
    3 | #include <functional
      |                     ^
Language: C++

#include<stdio.h>

int main()
{
	int high[10] = {1819,2003,876,2876,1723,1673,3776,2848,1592,922};
	
	for(int i=0;i<9;i++)
	{
		for( int cases; int j=i+1; j<10; j++)
		{
			if(high[i] < high[j])
			{
				cases = high[i];
				high[i] = high[j];
				high[j] = cases;
			}
		}
	}
	
	printf("%d",high[0]);
	printf("%d",high[1]);
	printf("%d",high[2]);
	
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:9:48: error: expected ')' before ';' token
    9 |                 for( int cases; int j=i+1; j<10; j++)
      |                    ~                           ^
      |                                                )
a.cc:9:50: error: 'j' was not declared in this scope
    9 |                 for( int cases; int j=i+1; j<10; j++)
      |                                                  ^
Language: C++

#include<stdio.h>

int main()
{
	int high[10] = {1819,2003,876,2876,1723,1673,3776,2848,1592,922};
	int cases
	
	for(int i=0;i<9;i++)
	{
		for(int j=i+1; j<10; j++)
		{
			if(high[i] < high[j])
			{
				cases = high[i];
				high[i] = high[j];
				high[j] = cases;
			}
		}
	}
	
	printf("%d",high[0]);
	printf("%d",high[1]);
	printf("%d",high[2]);
	
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'for'
    8 |         for(int i=0;i<9;i++)
      |         ^~~
a.cc:8:21: error: 'i' was not declared in this scope
    8 |         for(int i=0;i<9;i++)
      |                     ^
Language: C++

#include<stdio.h>

int main()
{
	int high[10];
	int cases;
	
	for(int i=0;i<9;i++)
	{
		printf("height of mountain %d",i);
		scanf("%d",&high[i]);
		pirntf("\n");
	}
	
	
	for(int i=0;i<9;i++)
	{
		for(int j=i+1; j<10; j++)
		{
			if(high[i] < high[j])
			{
				cases = high[i];
				high[i] = high[j];
				high[j] = cases;
			}
		}
	}
	
	printf("%d\n",high[0]);
	printf("%d\n",high[1]);
	printf("%d\n",high[2]);
	
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'pirntf' was not declared in this scope; did you mean 'printf'?
   12 |                 pirntf("\n");
      |                 ^~~~~~
      |                 printf
Language: C++

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

int main(void){
	int x[10],top[3];
	int i;

	for(i=0;i<3;i++){
		top[i] = 0;
	}
	for(i=0;i<10;i++){
		std::cin >> x[i];
		if(top[0] < x[i]){
			top[2] = top[1];
			top[1] = top[0];
			top[0] = x[i];
		}
		if(top[1] < x[i]){
			top[2] = top[1];
			top[1] = x[i];
		}
		if(top[2] < x[i]){
			top[2] = x[i];
		}
	}

	std::cout << top[0] << "\n" << top[1] << "\n" <<top[2] << "\n";
	return 0;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: no matching function for call to 'sort(int [11], int)'
   11 |         sort(arr,10);
      |         ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:11:13: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   11 |         sort(arr,10);
      |         ~~~~^~~~~~~~
/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 <stdio.h>
void sortarry(int* Array,int n )
{
int Tmp=0;
int i=0;
int j=0;

for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(Array[i]<Array[j] )
{
Tmp=Array[i];
Array[i]= Array[j];
Array[j]= Tmp;
}
}
}

return ;
}

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 <iostream>

int main()
{
    int i,high[10];
    for(i = 0;i < 10;++i){
        cin >> high[i];
    }
    sort(high[0]);
    cout << high[0];
    cout << high[1];
    cout << high[2];
}

void sort(int *a)
{
    int i,first = 0,secand = 0,third = 0;
    for(i = 0;i < 10;++i){
       if(first < *(a + i)){
           first = *(a + i);
       }else if(secand < *(a + i)){
           secand = *(a + i);
       }else if(third < *(a + i)){
           third = *(a + i);
       }
    }
    *a = first;
    *(a + 1) = secand;
    *(a + 2) = third;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> high[i];
      |         ^~~
      |         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:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |     sort(high[0]);
      |     ^~~~
      |     short
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout << high[0];
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>

int main()
{
    int i,high[10];
    for(i = 0;i < 10;++i){
        std::cin >> high[i];
    }
    sort(high[0]);
    std::cout << high[0];
    std::cout << high[1];
    std::cout << high[2];
}

void sort(int *a)
{
    int i,first = 0,secand = 0,third = 0;
    for(i = 0;i < 10;++i){
       if(first < *(a + i)){
           first = *(a + i);
       }else if(secand < *(a + i)){
           secand = *(a + i);
       }else if(third < *(a + i)){
           third = *(a + i);
       }
    }
    *a = first;
    *(a + 1) = secand;
    *(a + 2) = third;
}

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

#include <iostream>

int main()
{
    int i,high[10];
    for(i = 0;i < 10;++i){
        std::cin >> high[i];
    }
    manko::sort(high[0]);
    std::cout << high[0];
    std::cout << high[1];
    std::cout << high[2];
}

namespace manko{

void sort(int *a)
{
        int i,first = 0,secand = 0,third = 0;
        for(i = 0;i < 10;++i){
           if(first < *(a + i)){
               first = *(a + i);
           }else if(secand < *(a + i)){
               secand = *(a + i);
           }else if(third < *(a + i)){
               third = *(a + i);
           }
        }
        *a = first;
        *(a + 1) = secand;
        *(a + 2) = third;
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'manko' has not been declared
    9 |     manko::sort(high[0]);
      |     ^~~~~
Language: C++

#include <iostream>

void sort(int *a);

int main()
{
    int i,high[10];
    for(i = 0;i < 10;++i){
        std::cin >> high[i];
    }
    sort(high[0]);
    std::cout << high[0];
    std::cout << high[1];
    std::cout << high[2];
}

void sort(int *a)
{
        int i,first = 0,secand = 0,third = 0;
        for(i = 0;i < 10;++i){
           if(first < *(a + i)){
               first = *(a + i);
           }else if(secand < *(a + i)){
               secand = *(a + i);
           }else if(third < *(a + i)){
               third = *(a + i);
           }
        }
        *a = first;
        *(a + 1) = secand;
        *(a + 2) = third;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |     sort(high[0]);
      |          ~~~~~~^
      |                |
      |                int
a.cc:3:16: note:   initializing argument 1 of 'void sort(int*)'
    3 | void sort(int *a);
      |           ~~~~~^
Language: C++

#include <iostream>

void sort(int* a);

int main()
{
    int i,high[10];
    for(i = 0;i < 10;++i){
        std::cin >> high[i];
    }
    sort(high[0]);
    std::cout << high[0];
    std::cout << high[1];
    std::cout << high[2];
}

void sort(int* a)
{
        int i,first = 0,secand = 0,third = 0;
        for(i = 0;i < 10;++i){
           if(first < *(a + i)){
               first = *(a + i);
           }else if(secand < *(a + i)){
               secand = *(a + i);
           }else if(third < *(a + i)){
               third = *(a + i);
           }
        }
        *a = first;
        *(a + 1) = secand;
        *(a + 2) = third;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |     sort(high[0]);
      |          ~~~~~~^
      |                |
      |                int
a.cc:3:16: note:   initializing argument 1 of 'void sort(int*)'
    3 | void sort(int* a);
      |           ~~~~~^
Language: C++

v=[];v<<$_.to_i while gets
3.times{|i|p v.sort.reverse[i]}

Compiler output:
a.cc:1:1: error: 'v' does not name a type
    1 | v=[];v<<$_.to_i while gets
      | ^
a.cc:1:6: error: 'v' does not name a type
    1 | v=[];v<<$_.to_i while gets
      |      ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(){

  int a[10];fefepjp
  while(cin>>a[0]){
    for(int i=1;i<10;i++)cin>>a[i];
    sort(a,a+10,greater<int>());
    for(int i=0;i<4;i++)
      cout<<a[i]<<endl;
  }
  

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'fefepjp' was not declared in this scope
    8 |   int a[10];fefepjp
      |             ^~~~~~~
Language: C++

#include<iostream>

#include<algorithm>
 
int main()
{
    int height(10);
 
    for(int i=0;i<10;++i)
    {
        std::cin >> height[i];
    }
 
    std::sort(height.begin(),height.end());
 
    std::cout << height[9] << '\n';
 
    std::cout << height[8] << '\n';
 
    std::cout << height[7] << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: invalid types 'int[int]' for array subscript
   11 |         std::cin >> height[i];
      |                           ^
a.cc:14:22: error: request for member 'begin' in 'height', which is of non-class type 'int'
   14 |     std::sort(height.begin(),height.end());
      |                      ^~~~~
a.cc:14:37: error: request for member 'end' in 'height', which is of non-class type 'int'
   14 |     std::sort(height.begin(),height.end());
      |                                     ^~~
a.cc:16:24: error: invalid types 'int[int]' for array subscript
   16 |     std::cout << height[9] << '\n';
      |                        ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |     std::cout << height[8] << '\n';
      |                        ^
a.cc:20:24: error: invalid types 'int[int]' for array subscript
   20 |     std::cout << height[7] << '\n';
      |                        ^
Language: C++

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

int main(){
	int x[10];
	for(int i = 0; i < 10; i++){
		cin >> x[i];
	}
	sort(x,x + 10);
	cout << x[9] << endl; << x[8] << endl; << x[7] << endl;
	return 0;
}

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

#include<iostream>

int main(){
int high[10];
int highest[3];
for(int i=0;i<10;i++){
cin>>high[i];}
highest[0]=high[0];
for(int i=1;i<10;i++){
if(high[i]>highest[0]){
highest[2]=highest[1];
highest[1]=highest[0];
highest[0]=high[i];}
if(highest[0]>=high[i]&&high[i]>highest[1]){
highest[2]=highest[1];
highest[1]=high[i];}
if(highest[1]>=high[i]&&high[i]>highest[2]){
highest[2]=high[i];}}
for(int i=0;i<3;i++){
cout<<highest[i]<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin>>high[i];}
      | ^~~
      | 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:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 | cout<<highest[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:20:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 | cout<<highest[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++

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

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

#include<iostream>
using namespace std;

int main(){
    int a[10];
    for(int i=0;i<10;i++){
        cin>>a[i];
    }
    sort(a,a+10);
    cout<<a[9]<<endl<<a[8]<<endl<<a[7];
}

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

num = []
i=0
while i < 10
      num[i] = gets.to_i
      i+=1
end

num.sort!{|a, b| (-1) * (a <=> b)}

puts "result"
for n in 0..2
    puts "#{num[n]}"
end

Compiler output:
a.cc:11:10: error: too many decimal points in number
   11 | for n in 0..2
      |          ^~~~
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
    1 | num = []
      | ^~~
      | enum
a.cc:10:1: error: 'puts' does not name a type
   10 | puts "result"
      | ^~~~
Language: C++

num = []
i=0
while i < 10
      num[i] = gets.to_i
      i+=1
end

num.sort!{|a, b| (-1) * (a <=> b)}

for n in 0..2
    puts "#{num[n]}"
end

Compiler output:
a.cc:10:10: error: too many decimal points in number
   10 | for n in 0..2
      |          ^~~~
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
    1 | num = []
      | ^~~
      | enum
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for n in 0..2
      | ^~~
Language: C++

#include <iostream>

int main(int argc, const char * argv[])
{
    using namespace std;
        int max = 0;
        int second = 0;
        int third = 0;
    
    int n[10];
    
    for(int i = 0; i < 10; i++) cin >> n[i];
    sort(n,n+10,greater<int>());
    max = n[0];
    second = n[1];
    third  = n[2];
    cout << max << "\n" << second << "\n" << third << "\n";
    return 0;
}

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

#include <iostream>

int main()
{
    using namespace std;
        int max = 0;
        int second = 0;
        int third = 0;
    
    int n[10];
    
    for(int i = 0; i < 10; i++) cin >> n[i];
    sort(n,n+10,greater<int>());
    max = n[0];
    second = n[1];
    third  = n[2];
    cout << max << "\n" << second << "\n" << third << "\n";
    return 0;
}

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

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

int main(){
  std::vector<int> vech;
  for(int i = 0; i < 10; i++){
    std::cin >> vec[i];
  }
  std::sort(vec.begin(), vec.end(), std::greater<int>());
  for(int i = 0; i < 3; i++){
    std::cout << vec[i] << std::endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'vec' was not declared in this scope; did you mean 'vech'?
    8 |     std::cin >> vec[i];
      |                 ^~~
      |                 vech
a.cc:10:13: error: 'vec' was not declared in this scope; did you mean 'vech'?
   10 |   std::sort(vec.begin(), vec.end(), std::greater<int>());
      |             ^~~
      |             vech
Language: C++

#include<stdio.h>
int main(void)
{
int mount;
for(int f1=0;f1<10;f1++){
scanf("%d",&mount[f1]);
}
int mem;
for(int f1=0;f1<10;f1++){
for(int f2=0;f2<10;f2++){
if(mount[f1]>mount[f2]){
mem=mount[f1];
mount[f1]=mount[f2];
mount[f2]=mem;
}
}
}
for(int f1=0;f1<3;f1++){
printf("%d\n",mount[f1]);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: invalid types 'int[int]' for array subscript
    6 | scanf("%d",&mount[f1]);
      |                  ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
   11 | if(mount[f1]>mount[f2]){
      |         ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 | if(mount[f1]>mount[f2]){
      |                   ^
a.cc:12:10: error: invalid types 'int[int]' for array subscript
   12 | mem=mount[f1];
      |          ^
a.cc:13:6: error: invalid types 'int[int]' for array subscript
   13 | mount[f1]=mount[f2];
      |      ^
a.cc:13:16: error: invalid types 'int[int]' for array subscript
   13 | mount[f1]=mount[f2];
      |                ^
a.cc:14:6: error: invalid types 'int[int]' for array subscript
   14 | mount[f2]=mem;
      |      ^
a.cc:19:20: error: invalid types 'int[int]' for array subscript
   19 | printf("%d\n",mount[f1]);
      |                    ^
Language: C++

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

int main() {
  vector<int> v;
  for(int i = 0; i < 10; ++i) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end(), greater<int>());
  for(int i = 0; i < 3; ++i) cout << v[i] << endl;
  return 0;
}
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;

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

Compiler output:
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
Language: C++

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

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

#include<iostream>
using namespace std;
void main()
{
	int h[10];
	int i,j,t;
	for(i=0;i<10;i++)
	cin>>h[i];
	for(j=0;j<3;j++)
	{
		for(i=j+1;i<10;i++)
	   {
		 if(h[j]<h[i])
	     {
	     	t=h[j];
	        h[j]=h[i];
	        h[i]=t;
	     }
	   }
	   cout<<h[j]<<endl;
	}
}

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

#include <iostream>
using namespace std;

int main()
{
	int n[10],i=0;

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

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


#include <iostream>

using namespace std;

 int  main(){
     
int mnt[10];
int i;
int max;

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

sort(mnt,mnt+10);
reverse(mnt,mnt+10);
for(i=0;i<3;i++) cout<<mnt[i]<<endl;

  
 
   return 0;
}
 

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

#include <iostream>

using namespace std;

int  main(){
int mnt[10];
int i;
for(i=0;i<10;i++)
{
cin>>mnt[i];
}
sort(mnt,mnt+10);
reverse(mnt,mnt+10);
for(i=0;i<3;i++) 
cout<<mnt[i]<<endl;

return 0;
}

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

#include<iostream>
using namespace std;

int main()
{   
       int D[10]; 
       int i,k;
      
       
       for(i=1; i<=10; i++)
             {
             cin>>D[i];
             }
             sort(D,D+10);
             reverse(D,D+10);
             
       for(k=1; k<=3; k++)
       {
                cout <<D[k]<<endl;
                }
      
       
    
     return 0;
}

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

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

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(i=0;i<10;i++)
      |     ^
Language: C++

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

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

#include<stdio.h>

int main(void){

    /* 宣言と初期化 */
    int hai[10];
    int i;
    int temp2nd;
    int temp3rd
    int tempmax;

for(i=0;i<10;i++)
{
printf("山の高さ　");
scanf("%d",hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0]

    /* 計算 */
    for(i=0;i<=10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
        tempmax=hai[i];
    }

    for(i=0;i<=10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd)
        temp2nd=hai[i];
    }

    for(i=0;i<=10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd)
        temp3rd=hai[i];
    }

    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'int'
   10 |     int tempmax;
      |     ^~~
a.cc:19:5: error: 'tempmax' was not declared in this scope; did you mean 'tempnam'?
   19 |     tempmax=hai[0];
      |     ^~~~~~~
      |     tempnam
a.cc:20:5: error: 'temp3rd' was not declared in this scope; did you mean 'temp2nd'?
   20 |     temp3rd=hai[0]
      |     ^~~~~~~
      |     temp2nd
a.cc:23:22: error: expected ';' before ')' token
   23 |     for(i=0;i<=10;i++){
      |                      ^
      |                      ;
Language: C++

#include<stdio.h>
    
int main(void){
    
    /* 宣言と初期化 */
    int hai[10];
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
    
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
    
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       { tempmax=hai[i];
　　    hai[i]=0;}
    }
    
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd)
        {temp2nd=hai[i];hai[i]=0}
    }
    
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd)
        {temp3rd=hai[i];hai[i]=0}
    }
    
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
    
    return 0;
}

Compiler output:
a.cc:26:1: error: extended character 　 is not valid in an identifier
   26 | 　　    hai[i]=0;}
      | ^
a.cc:26:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:26:1: error: '\U00003000\U00003000' was not declared in this scope
   26 | 　　    hai[i]=0;}
      | ^~~~
a.cc:32:33: error: expected ';' before '}' token
   32 |         {temp2nd=hai[i];hai[i]=0}
      |                                 ^
      |                                 ;
a.cc:38:33: error: expected ';' before '}' token
   38 |         {temp3rd=hai[i];hai[i]=0}
      |                                 ^
      |                                 ;
Language: C++

#include<stdio.h>
      
int main(void){
      
    /* 宣言と初期化 */
    int hai[10];
    int id[2]
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
      
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
      
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       { tempmax=hai[i];id[0]=i;}
    }
      
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!hai[0])
        {temp2nd=hai[i];hai[1]=i;}
    }
      
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd&&i=!hai[1]&&i=!hai[0])
       {temp3rd=hai[i];}
    }
      
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
      
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
    8 |     int i;
      |     ^~~
a.cc:13:5: error: 'i' was not declared in this scope
   13 | for(i=0;i<10;i++)
      |     ^
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     for(i=0;i<10;i++){
      |         ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
   26 |        { tempmax=hai[i];id[0]=i;}
      |                         ^~
      |                         void
a.cc:29:9: error: 'i' was not declared in this scope
   29 |     for(i=0;i<10;i++){
      |         ^
a.cc:35:9: error: 'i' was not declared in this scope
   35 |     for(i=0;i<10;i++){
      |         ^
Language: C++

#include<stdio.h>
       
int main(void){
       
    /* 宣言と初期化 */
    int hai[10];
    int id[2]
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
       
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
       
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       { tempmax=hai[i];id[0]=i;}
    }
       
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
        {temp2nd=hai[i];hai[1]=i;}
    }
       
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
       {temp3rd=hai[i];}
    }
       
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
       
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
    8 |     int i;
      |     ^~~
a.cc:13:5: error: 'i' was not declared in this scope
   13 | for(i=0;i<10;i++)
      |     ^
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     for(i=0;i<10;i++){
      |         ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
   26 |        { tempmax=hai[i];id[0]=i;}
      |                         ^~
      |                         void
a.cc:29:9: error: 'i' was not declared in this scope
   29 |     for(i=0;i<10;i++){
      |         ^
a.cc:31:47: error: 'id' was not declared in this scope; did you mean 'void'?
   31 |         if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
      |                                               ^~
      |                                               void
a.cc:35:9: error: 'i' was not declared in this scope
   35 |     for(i=0;i<10;i++){
      |         ^
a.cc:37:51: error: 'id' was not declared in this scope; did you mean 'void'?
   37 |         if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
      |                                                   ^~
      |                                                   void
Language: C++

#include<stdio.h>
        
int main(void){
        
    /* 宣言と初期化 */
    int hai[10];
    int id[2]
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
        
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
        
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       { tempmax=hai[i];id[0]=i;}
    }
        
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
        {temp2nd=hai[i];id[1]=i;}
    }
        
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
       {temp3rd=hai[i];}
    }
        
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
        
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
    8 |     int i;
      |     ^~~
a.cc:13:5: error: 'i' was not declared in this scope
   13 | for(i=0;i<10;i++)
      |     ^
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     for(i=0;i<10;i++){
      |         ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
   26 |        { tempmax=hai[i];id[0]=i;}
      |                         ^~
      |                         void
a.cc:29:9: error: 'i' was not declared in this scope
   29 |     for(i=0;i<10;i++){
      |         ^
a.cc:31:47: error: 'id' was not declared in this scope; did you mean 'void'?
   31 |         if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
      |                                               ^~
      |                                               void
a.cc:35:9: error: 'i' was not declared in this scope
   35 |     for(i=0;i<10;i++){
      |         ^
a.cc:37:51: error: 'id' was not declared in this scope; did you mean 'void'?
   37 |         if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
      |                                                   ^~
      |                                                   void
Language: C++

#include<stdio.h>
        
int main(void){
    /* 宣言と初期化 */
    int hai[10];
    int id[2]
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
        
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];  
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       {tempmax=hai[i];id[0]=i;}
    }
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
        {temp2nd=hai[i];id[1]=i;}
    }    
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
       {temp3rd=hai[i];}
    }
        
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
        
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'int'
    7 |     int i;
      |     ^~~
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<10;i++)
      |     ^
a.cc:21:9: error: 'i' was not declared in this scope
   21 |     for(i=0;i<10;i++){
      |         ^
a.cc:24:24: error: 'id' was not declared in this scope; did you mean 'void'?
   24 |        {tempmax=hai[i];id[0]=i;}
      |                        ^~
      |                        void
a.cc:26:9: error: 'i' was not declared in this scope
   26 |     for(i=0;i<10;i++){
      |         ^
a.cc:28:49: error: 'id' was not declared in this scope; did you mean 'void'?
   28 |         if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
      |                                                 ^~
      |                                                 void
a.cc:31:9: error: 'i' was not declared in this scope
   31 |     for(i=0;i<10;i++){
      |         ^
a.cc:33:51: error: 'id' was not declared in this scope; did you mean 'void'?
   33 |         if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
      |                                                   ^~
      |                                                   void
Language: C++

#include<stdio.h>
         
int main(void){
    /* 宣言と初期化 */
    int hai[10];
    int id[2];
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
         
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0]; 
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       {tempmax=hai[i];id[0]=i;}
    }
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
        {temp2nd=hai[i];id[1]=i;}
    }   
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
       {temp3rd=hai[i];}
    }
         
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
         
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:42: error: lvalue required as left operand of assignment
   28 |         if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:33:57: error: lvalue required as left operand of assignment
   33 |         if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
      |                                                 ~~~~~~~~^~~~
Language: C++

#include<stdio.h>
           
int main(void){
    /* 宣言と初期化 */
    int hai[10];
    int id[2];
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
           
for(i=0;i<10;i++)
{
   cin >> hai[i];
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
    /* 計算 */
    for(i=0;i<10;i++){
        /* 最大値求める */
        if(hai[i]>tempmax)
       {tempmax=hai[i];id[0]=i;}
    }
    for(i=0;i<10;i++){
        /*2番目求める */
        if(hai[i]<tempmax&&hai[i]>temp2nd&& i != id[0])
        {temp2nd=hai[i];id[1]=i;}
    } 
    for(i=0;i<10;i++){
        /* 3番目求める */
        if(hai[i]>temp3rd&&hai[i]<temp2nd && i != id[1] && i != id[0])
       {temp3rd=hai[i];}
    }
           
    /* 表示 */
    printf("最も高い山の高さ　%d\n",tempmax);
    printf("２番目に高い山の高さ　%d\n",temp2nd);
    printf("３番目に高い山の高さ　%d\n",temp3rd);
           
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: 'cin' was not declared in this scope
   14 |    cin >> hai[i];
      |    ^~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
     
int main(void){
    /* 宣言と初期化 */
    int hai[10];
    int id[2];
    int i;
    int temp2nd;
    int temp3rd;
    int tempmax;
              
for(i=0;i<10;i++)
{
   cin >> hai[i];
}
    /* 代入 */
    temp2nd=hai[0];
    tempmax=hai[0];
    temp3rd=hai[0];
    /* 計算 */
for(int j=9;j>1;j--){
    for(i=0;i<j;i++){
        /* 最大値求める */
        if(hai[j]<hai[i])
       {tempmax=hai[i];
         hai[i]=hai[j];
         hai[j]=tempmax
        }
    }
    }

    /* 表示 */
    printf("%d\n",hai[9]);
    printf("%d\n",hai[8]);
    printf("%d\n",hai[7]);
              
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: expected ';' before '}' token
   30 |          hai[j]=tempmax
      |                        ^
      |                        ;
   31 |         }
      |         ~
Language: C++

#include <iostream>

using namespace std;


int main(){

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

	for (int i=0; i<10; i++){

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

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

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

	for (i=3; i<10; 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:22:14: error: 'i' was not declared in this scope
   22 |         for (i=1; i<10; i++){
      |              ^
a.cc:29:14: error: 'i' was not declared in this scope
   29 |         for (i=2; i<10; i++){
      |              ^
a.cc:36:14: error: 'i' was not declared in this scope
   36 |         for (i=3; i<10; i++){
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main(){

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

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

	max1 = a[0];

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

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

	for (i=3; i<10; 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=1; i<10; i++){
      |              ^
a.cc:27:14: error: 'i' was not declared in this scope
   27 |         for (i=2; i<10; i++){
      |              ^
a.cc:34:14: error: 'i' was not declared in this scope
   34 |         for (i=3; i<10; i++){
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main(){

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

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

	max1 = a[0];

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

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

	for (i=3; i<10; 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=1; i<10; i++){
      |              ^
a.cc:27:14: error: 'i' was not declared in this scope
   27 |         for (i=2; i<10; i++){
      |              ^
a.cc:34:14: error: 'i' was not declared in this scope
   34 |         for (i=3; i<10; i++){
      |              ^