Language: C++

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	try{
	    boolean flag, flag2=true;
	    while(true){
		String[] xt = sc.readLine().split(" ");
		int a = Integer.valueOf(xt[0]);
		int b = Integer.valueOf(xt[1]);
		if(a==0 && b==0)
		    break;
		flag = false;
		if(!flag2) System.out.println();
		for(int i=a; i<=b; i++)
		    if(i%4==0){
			if(i%400==0){
			    System.out.println(i);
			    flag = true;
			}
			else if(i%100==0)
			    ;
			else{
			    System.out.println(i);
			    flag = true;
			}
		    }
		if(!flag)
		    System.out.println("NA");
		flag2=false;
	    }
	}catch (Exception e){
	    System.out.println("Error");
	}
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
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.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:11: error: expected ':' before 'static'
    5 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:5:29: error: 'String' has not been declared
    5 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:5:38: error: expected ',' or '...' before 'args'
    5 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:38:2: error: expected ';' after class definition
   38 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:9: error: 'BufferedReader' was not declared in this scope
    6 |         BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
      |         ^~~~~~~~~~~~~~
a.cc:8:13: error: 'boolean' was not declared in this scope; did you mean 'bool'?
    8 |             boolean flag, flag2=true;
      |             ^~~~~~~
      |             bool
a.cc:10:17: error: 'String' was not declared in this scope
   10 |                 String[] xt = sc.readLine().split(" ");
      |                 ^~~~~~
a.cc:10:24: error: expected primary-expression before ']' token
   10 |                 String[] xt = sc.readLine().split(" ");
      |                        ^
a.cc:11:25: error: 'Integer' was not declared in this scope
   11 |                 int a = Integer.valueOf(xt[0]);
      |                         ^~~~~~~
a.cc:11:41: error: 'xt' was not declared in this scope
   11 |                 int a = Integer.valueOf(xt[0]);
      |                                         ^~
a.cc:15:17: error: 'flag' was not declared in this scope
   15 |                 flag = false;
      |                 ^~~~
a.cc:16:21: error: 'flag2' was not declared in this scope
   16 |                 if(!flag2) System.out.println();
      |                     ^~~~~
a.cc:16:28: error: 'System' was not declared in this scope
   16 |                 if(!flag2) System.out.println();
      |                            ^~~~~~
a.cc:20:29: error: 'System' was not declared in this scope
   20 |                             System.out.println(i);
      |                             ^~~~~~
a.cc:26:29: error: 'System' was not declared in this scope
   26 |                             System.out.println(i);
      |                             ^~~~~~
a.cc:31:21: error: 'System' was not declared in this scope
   31 |                     System.out.println("NA");
      |                     ^~~~~~
a.cc:32:17: error: 'flag2' was not declared in this scope
   32 |                 flag2=false;
      |                 ^~~~~
a.cc:34:17: error: 'Exception' does not name a type
   34 |         }catch (Exception e){
      |                 ^~~~~~~~~
a.cc:35:13: error: 'System' was not declared in this scope
   35 |             System.out.println("Error");
      |             ^~~~~~