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 <stdio.h>

int main(){

	int a,b;
	int i;
	int answer[1000];
	int count;

	while(1){

		count = 0;

		scanf("%d %d",&a,&b);

		if(a == 0 && b == 0){
			break;
		}

		for(i = a; i < b; i++){
			if( i % 400 == 0 || i % 100 !=0 && i % 4 ==0){
				answer[count] = i;
				count ++;
			}
		}

		for(i = 0; i < count; i++){
			printf("%d\n",answer[i]);
		}

		if(count == 0){
			printf("NA\n");
		}
	}

	return 0;
}

C++: 
#include<iostream>
using namespace std;
int main(){
	int a,b;
	while(1){
	cin >> a >> b; 
	if(a ==0 && b == 0) return 0;
	int k = 0;
	
	for(int i = a ;i<=b;i++){
		if(i % 100 == 0){
			if(i % 400 == 0){
			cout << i << endl; k++;
			}
		} else if(i % 4 == 0){
		cout << i << endl; k++;
			}
		}
		
		if(k ==0) cout << "NA" << endl ;
		cout << endl;		
		
		}
	
	}

C++: #include <stdio.h>

void leap_year(int start, int end)
{
    int y = 0;
    for (int x = start; x <= end; ++x) {
        if (x % 4 == 0 && (x % 100 != 0 || x % 400 == 0)) {
            printf("%d\n", x);
            ++y;
        }
    }
    if (y == 0) {
        printf("NA\n");
    }
}
        
int main(void)
{
    while (1) {
        int start, end;
        scanf("%d %d", &start, &end);
        if (start == 0 && end == 0) {
            break;
        } else {
            leap_year(start, end);
        }
    }
    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);
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            counter = 0;
            for(int i = start_year; i <= end_year; i++){
                counter += leap_year(i); 
                }
            if( counter == 0){
                printf("NA\n");
            } 
        }
        printf("\n");
    }
    return 0;
}
    
    
int leap_year(int x)
{
    if((x % 4 == 0 && !(x % 100 == 0)) || x % 400 == 0){
        printf("%d\n", x);
        return 1;
    }
    return 0;
}

C++: #include<iostream>
int main(){for(int a,b,c;std::cin>>a>>b,a||b;){c=0;for(;a<=b;a++)if(!a%400||!a%4&&a%100)c++,std::cout<<a<<'\n';if(!c)std::cout<<"NA\n";puts("");}}

C++: 
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii; 
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()

int main(void){
  int b,e;
  bool fa=false;
  while(cin >> b >> e , b+e){
    if(fa)cout<<endl;
    bool na=false;
    loop(i,b,e){
      if(i % 4 == 0){
	if(i % 100 == 0){
	  if(i % 400 == 0){
	    cout << i << endl;
	    continue;
	    na = true;
	  }
	  continue;
 	}
	cout << i << endl;
	na = true;
      }
    }
    if(!na)cout << "NA" << endl;
    fa = true;
  }

}

C++: #include <iostream>

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

int main()
{
	int a, b;
	
	while (true) {
		std::cin >> a >> b;
		std::cout << std::endl;
		if (a == 0 && b == 0) {
			break;
		} else {
			int i = 0;
			for (int j = a; j <= b; j++) {
				if (leap_year(j) == 0) {
					i++;
				} else {
					std::cout << j << std::endl;
				}
			}
			if ( i == a - b + 1) {
				std::cout << "NA" << std::endl;
			}
		}
	}
	
	return 0;
}

C++: #include <stdio.h>
int main(){
    int a,b,i,memory[3000]={0},cnt=0;
    while(1){
        scanf("%d %d",&a,&b);
        puts("");
        if(a==0&&b==0) break;
        for(i=a;i<=b;i++){
            if(i%400==0){
                memory[cnt]=i;
                cnt++;
            }else if(i%100!=0&&i%4==0){
                memory[cnt]=i;
                cnt++;
            }
        }
        if(cnt!=0){
            for(i=0;i<cnt;i++){
                printf("%d\n",memory[i]);
                memory[i]=0;
            }
        }else{
            puts("NA");
        }
        cnt=0;
        puts("");
    }
    return 0;
}

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

void leapyear (int year1, int year2)
{
    int i;
    int j = 0; 
    for (i = year1; i <= year2; ++i) {
        if (i % 4 == 0) {
            if (i % 100 != 0) {
                printf("%d\n", i);
                ++j;
            } else if (i % 400 == 0) {
                printf("%d\n", i);
                ++j;
            } 
        }
    }
    if (j == 0) {
        printf("NA\n");
    }
    printf("\n");
}

int main(void)
{
    while (true) {
        int year1, year2;
        scanf("%d %d", &year1, &year2);
        if (year1 == 0 && year2 == 0) {
            break;
        }
        leapyear(year1, year2);
    }
    return 0;
}

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

	while(cin>>a>>b,a||b){
		bool flag=true;
		for(int i=a;i<=b;i++){
			if(((i%4==0) && (i%100!=0)) ||( i%400==0) ){
				cout<<i<<endl;
				flag=false;
			}
		}
		if(flag)
			cout<<"NA"<<endl;
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>

bool judgeUruyear(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 a=0;
void printUruyear(int year_begin, int year_end)
{

    int count_year = 0;


    // kono for loop no jyouken-siki ha "=" hituyou
    for (int i = year_begin; i <= year_end; i++) {
        
        if (judgeUruyear(i)) {

            count_year += 1;
            std::cout << i << std::endl;
        }    
    }

    if (count_year == 0) { 
        std::cout << "NA" << std::endl;
    }
    if (a!=0){std::cout << std::endl; }
    a+=1;

}

int main()
{
    int year_begin, year_end;

    for (; true;) {

        std::cin >> year_begin >> year_end;

        if (year_begin == 0 && year_end == 0) {
            break;
        }

        printUruyear(year_begin, year_end);
    }
    
    return 0;
}