Language: C++

import java.util.*;

class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){
		int[] a = {1,5,10,50,100,500};
		int[] b = new int[6];

		int sum = 0;

		for(int i = 0; i < 6; i++){
			b[i] = in.nextInt();
			sum += b[i] * a[i];
		}

		int ans = (sum < 1000 ? 0 :1);

		System.out.println(ans);
	}
	
}

// while(in.hasNext()){
		// 	int n = in.nextInt();
		// 	if(n == 0) return;
			
		// }

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:4:42: error: expected ',' or '...' before 'args'
    4 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:8:2: error: expected ';' after class definition
    8 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Solve' was not declared in this scope
    5 |                 Solve s = new Solve();
      |                 ^~~~~
a.cc:6:17: error: 's' was not declared in this scope
    6 |                 s.solve();
      |                 ^
a.cc: At global scope:
a.cc:13:9: error: 'Scanner' does not name a type
   13 |         Scanner in = new Scanner(System.in);
      |         ^~~~~~~
a.cc:31:2: error: expected ';' after class definition
   31 | }
      |  ^
      |  ;
a.cc: In member function 'void Solve::solve()':
a.cc:16:20: error: structured binding declaration cannot have type 'int'
   16 |                 int[] a = {1,5,10,50,100,500};
      |                    ^~
a.cc:16:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:20: error: empty structured binding declaration
a.cc:16:23: error: expected initializer before 'a'
   16 |                 int[] a = {1,5,10,50,100,500};
      |                       ^
a.cc:17:20: error: structured binding declaration cannot have type 'int'
   17 |                 int[] b = new int[6];
      |                    ^~
a.cc:17:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:17:20: error: empty structured binding declaration
a.cc:17:23: error: expected initializer before 'b'
   17 |                 int[] b = new int[6];
      |                       ^
a.cc:22:25: error: 'b' was not declared in this scope
   22 |                         b[i] = in.nextInt();
      |                         ^
a.cc:22:32: error: 'in' was not declared in this scope; did you mean 'int'?
   22 |                         b[i] = in.nextInt();
      |                                ^~
      |                                int
a.cc:23:39: error: 'a' was not declared in this scope
   23 |                         sum += b[i] * a[i];
      |                                       ^
a.cc:28:17: error: 'System' was not declared in this scope
   28 |                 System.out.println(ans);
      |                 ^~~~~~