Language: C++

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;


class Main{
	public static void main(String[] args)throws IOException{
		int[] height=new int[10];
		String[] st=new String[10];

		File file=new File("in1.txt");
		BufferedReader br=new BufferedReader(new BufferedReader(new FileReader(file)));

		for(int i=0; i<10; i++){
			st[i]=br.readLine();
			height[i]=Integer.parseInt(st[i]);

			if(height[i]<0){
				height[i]*=-1;
			}
		}

		int a=0;		//a uses bubble sort


		for(int j=0; j<9; j++){
			for(int k=9; k>j; k--){
				if(height[k]<height[k-1]){
					a=height[k];
					height[k]=height[k-1];
					height[k-1]=a;

				}
			}
		}

		try{
			PrintWriter pw=new PrintWriter
					(new BufferedWriter(new FileWriter("out1.txt")));

			for(int l=0; l<3; l++){
				pw.println(height[9-l]);
			}
			pw.close();
		}

		catch(IOException e){
			System.out.println("err");
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedWriter;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.File;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.FileReader;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.io.FileWriter;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.io.IOException;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:15: error: expected ':' before 'static'
   11 |         public static void main(String[] args)throws IOException{
      |               ^~~~~~~
      |               :
a.cc:11:33: error: 'String' has not been declared
   11 |         public static void main(String[] args)throws IOException{
      |                                 ^~~~~~
a.cc:11:42: error: expected ',' or '...' before 'args'
   11 |         public static void main(String[] args)throws IOException{
      |                                          ^~~~
a.cc:11:46: error: expected ';' at end of member declaration
   11 |         public static void main(String[] args)throws IOException{
      |                                              ^
      |                                               ;
a.cc:11:47: error: 'throws' does not name a type
   11 |         public static void main(String[] args)throws IOException{
      |                                               ^~~~~~
a.cc:55:2: error: expected ';' after class definition
   55 | }
      |  ^
      |  ;