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 judge_leap_year(int a, int b);

int existance_leap_year(int a, int b);

int main(void)
{
    while(1) {
      int exist;
      int start_year, end_year;
      scanf("%d %d", &start_year, &end_year);
      if (start_year == 0 && end_year == 0) {
        break;
      } else {exist = existance_leap_year(start_year, end_year);
        if (exist == 1) {
          printf("\n");
          judge_leap_year(start_year, end_year);
          printf("\n");
        } else {
          printf("NA\n");
        }
      }
    }
    return 0;
}

void judge_leap_year(int a, int b)
{
    int year;
    for (year = a; year <= b; year++) {
      if (year % 400 == 0) {
        printf("%d\n", year);
      } else if (year % 4 == 0 && year % 100 != 0) {
        printf("%d\n", year);
      }
    }
}
//閏年を記述する                                                                                                                                                                     

int existance_leap_year(int a, int b)
{
    int n = 0;
    int year;
    for (year = a; year <= b; year++) {
      if (year % 400 == 0) {
        n = 1;
        break;
      } else if (year % 4 == 0 && year % 100 != 0) {
        n = 1;
        break;//一度閏年を検出した時点でループを抜ける。                                                                                                                             
      }
    }
    return n;
}
//閏年があった時、１を返す

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>

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

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>


using namespace std;

int main()
{
	while (true)
	{
		int a, b;
		scanf("%d %d", &a, &b);
		if (a == 0 && b == 0)
			break;

		bool notFound = true;
		for (int i = a; i <= b; ++i)
		{
			if (i % 4 == 0 && (i % 100 != 0 || i % 400 == 0))
			{
				printf("%d\n", i);
				notFound = false;
			}
		}
		if (notFound)
			puts("NA");
		printf("\n");
	}

	return 0;
}

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

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>

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

            if (isN) {
                printf("NA\n");
            }
            printf("\n");
        }
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

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

		for(; a <= b; a += 4){
			if(a%400 == 0 || a % 100 != 0){
				cout << a << endl;
			}
		}
		
		if(f == 0){
			cout << "NA" << endl;
		}
	}
	
	return 0;
}

C++: #include<stdio.h>
/*与えられた期間の間のうるう年をすべて出力*/
void leap_year(int year1, int year2);

int main(void)
{
    while (1){
        int a, b; /*a は year1　, b は year2*/
        scanf("%d %d", &a, &b);
        if (a == 0 && b == 0){
            break;
        }else if (a == b){
            printf("NA\n");
            printf("\n");
        }else {
            leap_year(a, b);
        }
    }
    return 0;
}

void leap_year(int year1, int year2)
{   
    int limit = 0; /*もしも、うるう年がなかった時に使う*/
    for (int i = year1; i <= year2; ++i){ /*i は年を表す*/
        if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0){
            printf("%d\n", i);
        }else{
            ++limit;
        }
    }
    if (limit == (year2 - year1 + 1)){/*うるう年がない場合*/
        printf("NA\n");
        printf("\n");
    }else{    /*うるう年がある場合*/
        printf("\n");
    }
}

C++: #include <stdio.h>

void Leap_Year(int start_year, int end_year)
{
    while ((start_year != 0) || (end_year != 0)) {
        if (end_year - start_year < 3) {
            if (((start_year % 4) <= (end_year % 4)) || ((start_year % 100) >= (end_year % 100))) { 
                if ((start_year % 400) <= (end_year % 400)) {
                    printf("NA\n");
                } else {
                    printf("%d\n", start_year + 4 - start_year % 4);
                }
            }
        } else {
            for (int i = start_year; i <= end_year; ++i) {
                if (i % 400 != 0) {
                    if ((i % 100 != 0) && (i % 4 == 0)) {
                        printf("%d\n", i);
                    }
                } else {
                    printf("%d\n", i);
                }
            }
        }
        scanf("%d %d", &start_year, &end_year);
        if ((start_year != 0) && (end_year != 0)) {
            printf("\n");
        }
    }
}

int main(void)
{
    
    int start_year, end_year;
    scanf("%d %d", &start_year, &end_year);
    Leap_Year(start_year, end_year);
    return 0;
}