Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

func isLeapYear(y int) bool {
	return (y%4 == 0 && y%100 > 0) || (y%4 == 0 && y%400 == 0)
}

func cntLeap(y []int) {
	cnt := 0

	for i := y[0]; i <= y[1]; i++ {
		if isLeapYear(i) {
			cnt++
			fmt.Println(i)
		}
	}

	if cnt == 0 {
		fmt.Println("NA")
	}
}

func main() {
	num := 0

	for sc.Scan() {
		y := Sliceconvtoi()

		if y[0] == 0 && y[1] == 0 {
			break
		}

		if num > 0 {
			fmt.Println()
		}

		cntLeap(y)
		num++
	}

}

C++: #include <iostream>

using namespace std;

int main(){
    int a,b;
    bool f = false;
    while(cin >> a >> b,a+b){
        if(f){
            cout << "" << endl;
        }
        f = true;
        bool flg=true;
        for(int i=a;i<=b;i++){
            if(i%4==0){
                if(i%100==0){
                    if(i%400==0){
                        flg=false;
                        cout << i << endl;
                    }
                }else{
                    flg=false;
                    cout << i << endl;
                }
            }
        }
        if(flg){
            cout << "NA" << endl;
        }

    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a,b;
    int f = 0;
    int ans[2000] = {0};
    int cnt = 0;
    int j = 0;
    for(;;){
        cin >> a >> b;
        if(a == 0 && b == 0)break;
        for(int i = a; i <= b; i++){
            if(i%4 == 0 && i%100 != 0){cnt++;ans[j] = i;j++;}
            else if(i%400 == 0){cnt++;ans[j] = i;j++;}
        }
        if(cnt == 0)printf("NA\n\n");
        else {
            for(int i = 0;i < j; i++)printf("%d\n",ans[i]);
            j = 0;
            cnt = 0;
            printf("\n");
        }

    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){

  int a,b,cnt,cnt2=0;

  while(1){
    
    cin >>a>>b;
    if(a == 0 && b == 0)break;

    cnt2++;
    cnt=0;
    
    for(int i=a; i <= b ; i++){
      
      if( i % 100 == 0 && i % 400 != 0 )continue;
      
      else{
	
	if( i%4 == 0 ){
	  cout <<i<<endl;
	  cnt++;
	}
	
      }
	
    }
    
    if(cnt ==0){
      cout <<"NA"<<endl;
    }

    if( cnt2 != 0 )cout <<endl;
    
  }
  return 0;
}

C++: #include <stdio.h>

int main(void)
{
    int a, b, count;
    while (1) {
        count = 0;
        scanf("%d %d", &a, &b);
        if ((a == 0) && (b == 0)) {
            break;
        } else {
            printf("\n");
            for (int i = a; i <= b; ++i) {
                if ((i % 4) == 0 && (!(i % 100) == 0 || (i % 400) == 0)) {
                    printf("%d\n", i);
                    ++count;
                }
            }
            if (count == 0) {
                printf("NA\n");
            }
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;

int main() {
	int a, b, c=0, n;
	while(++c) {
		cin >> a >> b;
		if(!a&&!b) break;
		if(c>1) cout << endl;
		n = 0;
		for(int i=a; i<=b; ++i) {
			if(!(i%4)&&(!(i%400)||i%100)) {
				cout << i << endl; n++;
			}
		}
		if(!n) cout << "NA" << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

  template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int a,b,x;
vector<int> leaps(3000,0);

void FilterLeap(){
  rep(i,3000){
    if(((i+1) % 400 == 0 || (i+1) % 4 == 0 )&& (i+1)%100 != 0){
      leaps[i+1] = 1;
    }
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  FilterLeap();
  while(cin >> a >> b){
    if(a + b == 0) break;
    x = 0;
    for(int i = a; i <=b ;++i){
      if(leaps[i] == 1){
        cout << i << endl;
      }
      else{
        ++x;
      }
    }
    if(x == b-a+1){
      cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
using namespace std;


int main(){
	int a, b;
	bool flag, ini=false;
	
	while(cin>>a>>b, a!=0&&b!=0){
		flag = false;
		if(ini)cout<<"\n";
		else   ini = true;
		while(a<=b){//cout<<a<<' '<<b<<"\n";
			if(a%4==0&&a%100!=0 || a%400==0){
				cout<<a<<"\n";
				flag = true;
			}
			a++;
		}
		if(!flag)cout<<"NA\n";
	}
	return 0;
}

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");
	}
    }
}

C++: #include <stdio.h>
#include <stdbool.h>

bool leap_year(int year)
{
    if (year % 400 == 0) {
        return true;
    } else if (year % 100 == 0) {
        return false;
    } else if (year % 4 == 0) {
        return true;
    } else {
        return false;
    }
}

int main(void)
{
    int y_ini, y_fin;
    int count = 0;
    while(1) {
        scanf("%d %d", &y_ini, &y_fin);
    
        if (y_ini == 0 || y_fin == 0) {
            break;
        }

        for (int year = y_ini; year < y_fin; year++) {
            if (leap_year(year) == true){
                printf("%d\n", year);
                count++;
            }
        }
        
        if (count == 0) {
            printf("NA\n");
        }
        
        printf("\n");
    }
            
    return 0;
}

C++: #include<stdio.h>
    
int leap_year(int x);
    
    
int main(void)
{
    int start_year, end_year, counter;
    while(1){
        scanf("%d %d", &start_year, &end_year);
        counter = 0;
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            for(int i = start_year; i <= end_year; i++){
                leap_year(i);
                counter += leap_year(i); 
                }
            if( counter == 0){
                printf("NA");
            }
        }
    }
    return 0;
}
    
    
int leap_year(int x)
{
    if(x % 4 == 0){
        printf("%d\n", x);
        return 1;
    }
    return 0;
}