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 <algorithm>
#include <vector>

using namespace std;

class Solver{
public:
	static void solve() {
		int a, b;
		cin >> a >> b;
		vector<string> res;

		while (a != 0 && b != 0) {
			int cnt = 0;
			for (int i = a; i <= b; i++) {
				if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
					string str("");
					int ii = i;
					while (ii > 0) {
						char c = '0' + ii % 10;
						str = string() + c + str;
						ii /= 10;
					}
					res.push_back(str);
					cnt++;
				}
			}
			if (cnt == 0)res.push_back("NA");
			cin >> a >> b;
			if (a != 0 && b != 0)res.push_back("");
		}

		for (int i = 0; i < res.size(); i++)cout << res[i] << endl;
	}
};

int main() {
	Solver::solve();
}

C++: #include <stdio.h>
#include <stdbool.h>

void leapyear(int a, int b);
int a, b;
bool flag,flag2 = true;
int main(void)
{
    while (1) {
        flag =true;
        scanf("%d %d", &a, &b);
        if (a == 0 && b == 0) {
            break;
        }
        if (flag2 == true) {
            flag2 =false;
        } else {
            printf("\n");
        }
        leapyear(a, b);
    }
    return 0;
}

void leapyear(int a, int b)
{
    for (int i = a; b >= i; ++i) {
        if (i % 4 == 0) {
            if (i % 100 == 0) {
                if (i % 400 == 0) {
                    printf("%d\n", i);
                    flag = false;
                }
            } else {
                printf("%d\n", i);
                flag = false;
            } 
        }
    }
    if (flag == true) {
        printf("NA\n");
    }
}

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

int main(){
    int A=-1,B=-1;
    bool f = false;
    while(cin>>A>>B, A||B){
        if(f) puts("");
        bool no = true;
        for(int i=A;i<=B;i++){
            if(i%4==0 && (i%100!=0 || i%400==0)) printf("%d\n",i), no = false;
        }
        if(no) puts("NA");
        f = true;
    }
    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>
#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 << "NB" << endl;
		cout << endl;
	}
}
int main() {
	q93();
	return 0;
}

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

int a, b;

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

C++: #include<stdio.h>
int main()
{
	int a,b,c,i,d=0;
	while(scanf("%d%d",&a,&b),a)
	{
		if(d++) putchar('\n');
		for(c=0,i=a;i<=b;++i)
		{
			if(i%400 == 0 || (i%100 && (i&3)==0))
				printf("%d\n",i),++c;
		}
		if(!c)
			puts("NA");
	}
	return 0;
}

C++: #include <stdio.h>

void uruu(int a, int b);

int main(void)
{
    int a;
    int b;
    scanf("%d %d", &a, &b);
    while (a != 0 || b != 0) {
        uruu(a, b);
        scanf("%d %d", &a, &b);
    }
    return 0;
}


void uruu(int a, int b)
{
    int count = 0;
    for (int year = a; year <= b; ++year) {
        if (year % 4 == 0) {
            if (year % 100 != 0) {
                printf("%d\n", year);
                ++count;
            } else {
                if (year % 400 == 0) {
                    printf("%d\n", year);
                    ++count;
                }
            }
        }   
    }
    if (count == 0) {
        printf("NA\n");
    }
}

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

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;
	}
}