Language: C++

import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main {
	static BufferedReader br;

	public static void main(String[] args) {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			String S = br.readLine();
			double length = S.length();
			double sum = 0;
			for (int i = 0; i < length; i++) {
				double left = Math.ceil(Math.pow(2, i - 1));
				for (int j = i + 1; j < length + 1; j++) {
					String s = S.substring(i, j);
					double n = Double.valueOf(s);
					double right = Math.ceil(Math.pow(2, length - j - 1));
					sum += left * n * right;
				}
			}
			System.out.println(sum);
		} catch (Exception e) {
			System.err.println("Error : " + e.getMessage());

		}

	}
}


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.InputStreamReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:16: error: 'BufferedReader' does not name a type
    5 |         static BufferedReader br;
      |                ^~~~~~~~~~~~~~
a.cc:7:15: error: expected ':' before 'static'
    7 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:7:33: error: 'String' has not been declared
    7 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:7:42: error: expected ',' or '...' before 'args'
    7 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:29:2: error: expected ';' after class definition
   29 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:9:25: error: 'br' was not declared in this scope
    9 |                         br = new BufferedReader(new InputStreamReader(System.in));
      |                         ^~
a.cc:9:34: error: expected type-specifier before 'BufferedReader'
    9 |                         br = new BufferedReader(new InputStreamReader(System.in));
      |                                  ^~~~~~~~~~~~~~
a.cc:10:25: error: 'String' was not declared in this scope
   10 |                         String S = br.readLine();
      |                         ^~~~~~
a.cc:11:41: error: 'S' was not declared in this scope
   11 |                         double length = S.length();
      |                                         ^
a.cc:14:47: error: 'Math' was not declared in this scope
   14 |                                 double left = Math.ceil(Math.pow(2, i - 1));
      |                                               ^~~~
a.cc:16:48: error: expected ';' before 's'
   16 |                                         String s = S.substring(i, j);
      |                                                ^
a.cc:17:52: error: 'Double' was not declared in this scope; did you mean 'double'?
   17 |                                         double n = Double.valueOf(s);
      |                                                    ^~~~~~
      |                                                    double
a.cc:17:67: error: 's' was not declared in this scope
   17 |                                         double n = Double.valueOf(s);
      |                                                                   ^
a.cc:22:25: error: 'System' was not declared in this scope
   22 |                         System.out.println(sum);
      |                         ^~~~~~
a.cc:23:26: error: 'Exception' does not name a type
   23 |                 } catch (Exception e) {
      |                          ^~~~~~~~~
a.cc:24:25: error: 'System' was not declared in this scope
   24 |                         System.err.println("Error : " + e.getMessage());
      |                         ^~~~~~
a.cc:24:57: error: 'e' was not declared in this scope
   24 |                         System.err.println("Error : " + e.getMessage());
      |                                                         ^