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>

void leap_year(int a, int b);

int main(void)
{
    while (1){
        int a, b;
        scanf("%d %d", &a, &b);
        if (a == 0 && b ==0) {
            break;
        } else {
            leap_year(a, b);
        }
    }
    return 0;
}

void leap_year(int a, int b)
{
    int count = 0;
    for (int i = a; i <= b; i++){
        if (i % 400 == 0) { //iが４００の倍数の時
            printf("%d\n", i);
            count = + 1;
        } else if (i % 100 != 0) { //iが100の倍数のでないとき  
            if ( i % 4 == 0) {//iが四の倍数のとき
                printf("%d\n", i);
                count = + 1;                
            }
        }
    }
    if (count == 0) { //閏年が0のとき        
        printf("NA\n\n");
    } else {
        printf("\n");
    }    
}

C++: #include <stdio.h>
	
void uruu(int first, int end)
{
	int count = 0;
	for (int i = first; i < end + 1; i++) {	
		if (i % 400 == 0) {
			printf("%d\n", i);
			count = count + 1;
		} else if (i % 100 == 0) {
			i = i + 3;
		} else if (i % 4 == 0) {
			printf("%d\n", i);
			count = count + 1;
		}
	}
	if (count == 0) {
		printf("NA\n");
	}
}
	
int main(void)
{	
	int first, end, dataset;
	dataset = 0;
	while (1) {
		if (dataset > 0) {
			printf("\n");
		}
		scanf("%d %d", &first, &end);
		if (first == 0 && end == 0) {
			break;
		} else {
			printf("\n");
			uruu(first, end);
		}
		dataset = dataset++;
	}
	return 0;
}

C++: 
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>

using namespace std;
bool uru[3000];

void q93() {
	memset(uru, 0, sizeof(uru));
	for (int i = 0; i < 3000; i += 4) {
		uru[i] = true;
	}
	for (int i = 0; i < 3000; i += 100) {
		uru[i] = false;
	}
	for (int i = 0; i < 3000; i += 400) {
		uru[i] = true;
	}

	int a, b;
	for (; cin >> a >> b;) {
		if (!a) break;
		bool print_flag = false;
		for (int i = a; i <= b; i++) {
			if (uru[i]) {
				cout << i << endl;
				print_flag = true;
			}
		}
		if (!print_flag) cout << "NA" << endl;
		cout << endl;
	}
}
int main() {
	q93();
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int a,b;

	while(1){

		int count = 0;

		cin >> a >> b;
		cout << endl;
		if(a == 0 && b == 0) break;

		for(int i = a; i <= b; i++){

			if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0){
				cout << i << endl;
				count++;
			}

		}

		if(count == 0){
			cout << "NA" << endl;
		}

		cout << endl;
	}

	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 {
            for (int i = a+1; i < b; ++i) {
                if ((i % 4) == 0 && (!(i % 100) == 0 || (i % 400) == 0)) {
                    printf("%d\n", i);
                    ++count;
                }
            }
            if (count == 0) {
                printf("NA\n");
            }
        }
        printf("\n");
    }
    return 0;
}

C++: #include <iostream>

bool judge_uruyear(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;
    }

}

void print_uruyear(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 (judge_uruyear(i)) {
            count_year += 1;
            std::cout << i << std::endl;
        }    
    }

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

    std::endl(std::cout);

}

int main()
{

    int year_begin, year_end;

    while(true) {
        
        std::cin >> year_begin >> year_end;
        
        if(year_begin == 0 && year_end == 0) {
            break;
        }
        
        print_uruyear(year_begin, year_end);

    }
    
    return 0;
}

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

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

C++: #include <iostream>
using namespace std;
int main(){
	int n1,n2;
	bool g = false;
	while(cin >> n1 >> n2){
		if(!(n1&&n2)) break;
		if(g) cout << endl;
		g = true;
		bool f = false;
		for(int year=n1; year<=n2; year++){
			if(year%400==0 || (year%4==0&& year%100!=0) ){
				f = true;
				cout << year << endl;
			}
		}
		if(!f) cout << "NA" << endl;
		
	}
	return 0;
}

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

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

C++: #include <stdio.h>
int main(){
    int a,b,i,memory[3000]={0},cnt=0;
    while(1){
        scanf("%d %d",&a,&b);
        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 <iostream>

int main()
{
	while (true) {
        int x;
	    int y;
	    int z[3];
	    bool flag;
	    int n;
	    std::cin >> x >> y;
	    if (x == 0 && y == 0) break;
	    n = y-x+1;
	    for (int i=0; i < n; i ++) {
		    z[0] = (x+i) % 4;
		    z[1] = (x+i) % 100;
		    z[2] = (x+i) % 400;
		    if (z[0] == 0) {
			    if(z[1] == 0) {
				    if(z[2] == 0) {
					    flag = true;
				    } else {
					    flag = false;
				    }
			    } else {
				    flag = true;
			    }
		    } else {
	  	  	    flag = false;
	  	    }
	  	    if (flag) std::cout << x+i << std::endl;
	  	 }
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <set>
#include <cmath>
#include <map>
using namespace std;

bool isLeap(const int y){
	if(!(y%400)) return true;
	if(!(y%100)) return false;
	if(!(y%4)) return true;
	return false;
}

int main(int,char**){
	int a,b;
	while(std::cin >> a>> b){
		if(!a&&!b) break;
		bool ex(0);
		for(int i(a);i<=b;++i){
			if(isLeap(i)) {
				cout << i <<endl;
				ex = true;
			}
		}
		if(!ex) cout << "NA" <<endl;
		cout <<endl;
	}
	return 0;
}