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<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

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

C++: #include<cstdio>
#include<iostream>
#include<utility>

#define NMAX 1000000

using namespace std;

int main(void){

	int a,b;
	bool f;

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

	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);
            printf("\n");
        }
    }
    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\n");
    }    
}

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

C++: #include <iostream>


int leap_year(int y) {
	if( y % 400 == 0) {
		return 1;/*???????????´*/
	} else if (y % 100 == 0 && y % 400 != 0) {
		return 0;/*???????????´??§??????*/
	} else if (y % 4 == 0 && y % 100 != 0) {
		return 1;
	} else {
		return 0;
	}
}
int main()
{
	int a;
	int b;
	while (true) {
		std::cin >> a >> b;
		if (a == 0 && b == 0) {
			break;
		} else {
			std::cout << std::endl;
			int sum = 0;
			for (int k = a; k <= b; k++) {
				sum = sum + leap_year(k);
			}
			if (sum == 0 /*????????????????????´?????????*/) {
				std::cout << "NA" << std::endl;
			} else {
			    for (int i =a; i <= b; i++) {
					if (leap_year(i) == 1) {
						std::cout << i << std::endl;
					}
				}
			}
		}
	}
	return 0;
}

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

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;



/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/


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


int main()
{
	int a, b;
	
	while (cin >> a >> b, a || b)
	{
		bool flag = false;
		
		for (int y=a; y<=b; y++)
		{
			if (isLeapYear(y))
			{
				cout << y << endl;
				flag = true;
			}
		}
		
		if (!flag) cout << "NA" << endl;
	}
	
	return 0;
}

C++: #include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

int main() {
    for (int _q = 0;; _q++) {
        if (_q) puts("");
        int a, b;
        scanf("%d%d", &a, &b);
        if (a == 0 && b == 0) return 0;
        int c = 0;
        for (int i = a; i <= b; i++) if (leap(i)) {
            printf("%d\n", i);
            c++;
        }
        if (c == 0) puts("NA");
    }
    return 0;
}

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

int main()
{
	int a, b;

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

		if (check){
			printf("NA\n");
		}

		printf("\n");
	}

	return (0);
}

C++: #include <stdio.h>

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

	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>
using namespace std;

int main()
{
	int count = 0;
	int syear,eyear;
	while(cin >> syear && cin >> eyear){
		if(syear == 0)
			break;
		else{
			if(count!=0)
				cout << endl;
		}			
		bool flag = false;
		for(int i=syear;i<=eyear;i++){
			if(i%4==0){
				if(i%400==0){
					flag = true;
					cout << i << endl;
				}
				else if(i%100==0){
				}
				else{
					flag = true;
					cout << i << endl;
				}
			}
		}
		if(flag==false)
			cout << "NA" << endl;
		count++;
	}
	return 0;
}