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 <iostream>
#include <cstdio>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <string>

#include <fstream>
#include <iomanip>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <nmmintrin.h>
#include <chrono>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#ifdef _MSC_VER
#define __builtin_popcount _mm_popcnt_u32
#define __builtin_popcountll _mm_popcnt_u64
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}

struct Edge {
	int from, to, weight;

	bool operator < (const Edge& obj) const {
		return weight < obj.weight;
	}
	bool operator > (const Edge& obj) const {
		return weight > obj.weight;
	}
};

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) { //????????\??£??????????????¨ y?????\??£?????????????????????
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) { //x??¨y????????????????????\??£??????????????????????????????
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	bool isroot(int x) {
		return data[x] < 0;
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int arr[100001];
void Eratosthenes(int N) {//N?????§????´???°??¨
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (int i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (int j = i * 2; j <= N; j += i) {
				arr[j] = 0;
			}
		}
	}
}

int main()
{
	while (1) {

	int a, b;
	cin >> a >> b;

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

	int cou = 0;
	rep(i, a, b + 1) {
		if ((i % 4) == 0 && i % 100) cou++;
		else if ((i % 400) == 0) cou++;
	}

	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

bool is_yeap(int y){
    return y%400==0||(y%4==0&&y%100);
}
int main(){
    int a,b;
    bool flag=false;

    while(scanf("%d%d",&a,&b),a||b){
        if(flag)puts("");
        else flag=true;
        bool latte=false;
        for(int i=a;i<=b;i++){
            if(is_yeap(i)){
                printf("%d\n",i);
                latte=true;
            }
        }

        if(!latte)puts("NA");
    }

    return 0;
}

C++: #include <stdio.h>

int leapyear(int y){
    if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)return 1;
        else return 0;
}

int main(void){
    int a,b,count,first=1;
    while(scanf("%d %d",&a,&b) != EOF && ( a != 0 || b != 0)){
        count=0;
        if(first == 0)printf("\n");
        for(int y = a;y <= b;y++){
            if(leapyear(y) == 1){
                printf("%d",y);
                count++;
                if(y < b)printf("\n");
            }
        }
        if(count == 0)printf("NA\n");
        first=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 {
			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;
					}
				}
			}
			std::cout << std::endl;
			std::cout << std::endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    bool first = true;
    for(;;){
        int a, b;
        cin >> a >> b;
        if(a == 0)
            return 0;

        if(!first)
            cout << endl;
        else
            first = false;

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

C++: #include <iostream>
using namespace std;
#include <algorithm>
#include <stdio.h>
int main(void)
{
	int a[100], b[100], i = 0, j, k;
	bool flag = false;
	
	while (1){
		cin >> a[i] >> b[i];
		if (a[i] == 0 && b[i] == 0) break;
		if (a[i] % 400 < 400 - 4){ a[i] += 4 - (a[i] % 4); }
		i++;
	}
	for (j = 0; j < i; j++){
		if (j != 0) { printf("\n"); }
		for (k = a[j]; k <= b[j];k+=4){
			if (k % 100 == 0){
				if (k % 400 == 0) {
					printf("%d\n", k); 
					flag = true; 
				}
			}
			else {
				printf("%d\n", k);
				if (k % 400 > 400 - 4){
					printf( "%d\n", k + (400 - (k % 400)) ); 
				}
				flag = true;
			}
		}
		if (flag == false) { printf("NA\n"); }
		flag = false;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main() {
	int a, b;
	vector<int>aa;
	vector<int>bb;
	while (cin >> a >> b) {
		if (a == 0 && b == 0)break;
		aa.push_back(a);
		bb.push_back(b);
	}
	for (int i = 0; i != aa.size(); i++){
		bool b = false;
		for (int j = aa[i]; j <= bb[i]; j++){
		if (j % 4 == 0) 
			if (j % 100 == 0) {
				if (j % 400 == 0) {
					b = true;
					cout << j << endl;
				}
			}
			else {
				b = true;
				cout << j << endl; 
			}
		}
		if (b == false)cout << "NA\n";
		if (i != aa.size() - 1)cout << endl;
	}
	char c;
	cin >> c;
}