Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	}

	static int searchMin(List<Integer> list) {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	}

	static int searchMax(List<Integer> list) {
		int max = 0;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	}

	static int sum(List<Integer> list) {
		int sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	}
}

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.IOException;
      | ^~~~~~
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.InputStreamReader;
      | ^~~~~~
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.util.ArrayList;
      | ^~~~~~
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.util.List;
      | ^~~~~~
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.util.Scanner;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:15: error: expected ':' before 'static'
    9 |         public static void main(String[] args) throws IOException {
      |               ^~~~~~~
      |               :
a.cc:9:33: error: 'String' has not been declared
    9 |         public static void main(String[] args) throws IOException {
      |                                 ^~~~~~
a.cc:9:42: error: expected ',' or '...' before 'args'
    9 |         public static void main(String[] args) throws IOException {
      |                                          ^~~~
a.cc:9:46: error: expected ';' at end of member declaration
    9 |         public static void main(String[] args) throws IOException {
      |                                              ^
      |                                               ;
a.cc:9:48: error: 'throws' does not name a type
    9 |         public static void main(String[] args) throws IOException {
      |                                                ^~~~~~
a.cc:20:30: error: 'List' has not been declared
   20 |         static int searchMin(List<Integer> list) {
      |                              ^~~~
a.cc:20:34: error: expected ',' or '...' before '<' token
   20 |         static int searchMin(List<Integer> list) {
      |                                  ^
a.cc:30:30: error: 'List' has not been declared
   30 |         static int searchMax(List<Integer> list) {
      |                              ^~~~
a.cc:30:34: error: expected ',' or '...' before '<' token
   30 |         static int searchMax(List<Integer> list) {
      |                                  ^
a.cc:40:24: error: 'List' has not been declared
   40 |         static int sum(List<Integer> list) {
      |                        ^~~~
a.cc:40:28: error: expected ',' or '...' before '<' token
   40 |         static int sum(List<Integer> list) {
      |                            ^
a.cc:47:2: error: expected ';' after class definition
   47 | }
      |  ^
      |  ;
a.cc: In static member function 'static int Main::searchMin(int)':
a.cc:22:37: error: 'list' was not declared in this scope
   22 |                 for (int i = 0; i < list.size(); i++) {
      |                                     ^~~~
a.cc: In static member function 'static int Main::searchMax(int)':
a.cc:32:37: error: 'list' was not declared in this scope
   32 |                 for (int i = 0; i < list.size(); i++) {
      |                                     ^~~~
a.cc: In static member function 'static int Main::sum(int)':
a.cc:42:37: error: 'list' was not declared in this scope
   42 |                 for (int i = 0; i < list.size(); i++) {
      |                                     ^~~~