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

C++: #include <iostream>

bool ifEndValInput(int input_n1, int input_n2);
bool inputValRangeCheck(int input_n1, int input_n2);
void printLeapYear(int start_y, int end_y);
bool isLeapYear(int year);


int main()
{
    bool is_input_started = true;
    while (true) {
        int start_year, end_year;
        std::cin >> start_year >> end_year;
        if (ifEndValInput(start_year, end_year)) {
            break;
        }
        if (!is_input_started) {
            std::cout << std::endl;
        } else {
            is_input_started = false;
        }
        if (inputValRangeCheck(start_year, end_year)) {
            printLeapYear(start_year, end_year);
        }  
    }
    std::cout << std::endl;
    return 0;
}

bool ifEndValInput(int input_n1, int input_n2)
{
    if (input_n1 == 0 && input_n2 == 0) {
        return true;
    }
    return false;
}

bool inputValRangeCheck(int input_n1, int input_n2)
{
    if (input_n1 <= 0 || input_n1 > input_n2 || input_n2 >= 3000) {
        return false;
    }
    return true;
}


bool isLeapYear(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 printLeapYear(int start_y, int end_y)
{
    bool does_leap_year_exist = false;
    for (int i = start_y; i <= end_y; i++) {
        if (isLeapYear(i)) {
            std::cout << i << std::endl;
            does_leap_year_exist = true;
        }
    }
    if (!does_leap_year_exist) {
        std::cout << "NA" << std::endl;
    }
}

C++: #include <iostream>

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

int main(){
    int a,b;
    bool noLY;
    bool firstSet=true;
    while (true) {
        noLY = true;
        std::cin >> a >> b;
        
        if (a==0 && b==0) {
            break;
        }
        
        if (!firstSet) {
            std::cout << std::endl;
        }

        for (int i=0; i <= (b-a); i++) {
            if (isLY(a+i)) {
                std::cout << a+i << std::endl;
                noLY = false;
            }
        }
        if(noLY){
            std::cout << "NA\n";
        }
        firstSet = false;
    }
    return 0;
}

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++){
        int j = i;
        if (i - j / 400 * 400 == 0) { //iが４００の倍数の時
            printf("%d\n", i);
            count = + 1;
            j = i;
        } else if (!(i - j / 100 * 100 == 0)) { //iが100の倍数のでないとき
            int j = i;  
            if ( i - j / 4 * 4 == 0) {//iが四の倍数のとき
                printf("%d\n", i);
                count = + 1;                
            }
        }
    }
    if (count == 0) { //閏年が0のとき
        printf("NA");
    }    
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, tmp, tmp2;
	
	while(1){
		cin >> a >> b;
		if(a == 0 && b == 0){
			break;
		}
		tmp = 0;
		for(int i = a; i <= b; i++){
			if(i % 400 == 0 || (i % 100 != 0 && i % 4 == 0)){
				tmp2 = i + 4;
				cout << i << endl;
				tmp++;
				break;
			}
		}
		
		for(int i = tmp2; i <= b; i += 4){
			if(i % 100 != 0 || i % 400 == 0){
				cout << i << endl;
			}
		}
		if(tmp == 0){
			cout << "NA" << endl << endl;
		} else {
			cout << endl;
		}
	}
	
	return 0;
}

C++: 

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>
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 == b && !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 << "\n";
	}
}
int main() {
	q93();
	return 0;
}

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 + 1; year++) {
            if (leap_year(year) == true){
                printf("%d\n", year);
                count++;
            }
        }
        
        if (count == 0) {
            printf("NA\n");
        }
        
        printf("\n");
    }
            
    return 0;
}

C++: // 2011/03/29 Tazoe

#include <iostream>
using namespace std;

int main()
{
	bool spc = false;

	while(true){
		int a, b;
		cin >> a >> b;
		if(a==0&&b==0)
			break;

		if(spc)
			cout << endl;
		else
			spc = true;

		bool flg = false;
		for(int i=a; i<=b; i++){
			if(i%400==0){
				cout << i << endl;
				flg = true;
			}
			else if(i%100==0){
				continue;
			}
			else if(i%4==0){
				cout << i << endl;
				flg = true;
			}
		}
		if(!flg)
			cout << "NA" << endl;
	}

	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("\n");
                printf("%d\n", i);
                ++j;
            } else if (i % 400 == 0) {
                printf("\n");
                printf("%d\n", i);
                ++j;
            } 
        }
    }
    if (j == 0) {
        printf("NA\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;
}