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 <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 << endl;
	}
}
int main() {
	q93();
	return 0;
}

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) {
          judge_leap_year(start_year, end_year);
        } 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);
        }
      }
    printf("\n");
}
//閏年を記述する                                                                                                                                                                     

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 <stdio.h>

void Leap_Year(int start_year, int end_year)
{
    while ((start_year != 0) || (end_year != 0)) {
        if (0 < 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 if(start_year == end_year) {
            if (((start_year % 4 == 0) && (start_year % 100 != 0)) || (start_year % 400 == 0)) {
                printf("%d\n", start_year);
            } else {
                printf("NA\n");
            } 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;
}

C++: #include<cstdio>
main(){int a,b,d=0,c;while(scanf("%d%d",&a,&b),a){if(d++)puts("");c=0;for(;a<=b;a++)if(a%4<1)if(a%100)c++,printf("%d\n",a);else if(a%400<1)c++,printf("%d\n",a);if(!c)puts("NA");}}

C++: #include <iostream>
using namespace std;
int main()
{
	int a, b, i;
	bool f, g = false;
	while (cin >> a >> b)
	{
		if (g) cout << endl;
		if (a == 0 && b == 0) break;
		for (i = a, f = false; i <= b; i++)
		{
			if (i%4 == 0)
			{
				if (i%100 == 0 && i%400 != 0) continue;
				cout << i << endl;
				f = true;
			}
		}
		if (!f) cout << "NA" << endl;
		g = true;
	}
}

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

bool judge(int year);

int main() 
{
	int start, end;
	
	while (true) {
		int check = 0;
		std::cin >> start >> end;
		
		if (start == 0 && end == 0) {
			break;
		}
		
		for (int i = start; i <= end; i++) {
			if (judge(i)) {
				std::cout << i << std::endl;
				check = 1;
			}
		}
		
		if (check == 0) {
			std::cout << "NA" << std::endl;
		}
		
		std::cout << std::endl;
	}
	return 0;
}


bool judge(int year){
	if ((year % 4 == 0 && !(year % 100 == 0)) || year % 400 == 0) {
		return true;
	} else {
		return false;
	}
}

C++: #include <iostream>

void leapYear(int, int);
int main()
{
  int check1 = 0;
    while (true) {
        int a, b;
        std::cin >> a >> b;
        if (a == 0 && b == 0) {
            break;
        }
        if (check1 == 1) {
            std::cout << std::endl;
        }
        check1 = 1;
        leapYear(a, b);
    }
    return 0;
}
void leapYear(int a, int b)
{
    int check2 = 0;
    for (int year = a; year <= b; ++year) {
      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
            std::cout << year <<std::endl;
            check2 = 1;
      }
    }
    if (check2 == 0) {
        std::cout << "NA" <<std::endl;
    }
}

C++: #include <stdio.h>

int main(void)
{
	while (1){
		int a, b;
		int n = 0;
		scanf("%d %d", &a, &b);

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

		for (int i = a; i <= b; i++) {
			if (i % 4 == 0) {
				if (i % 100 == 0) {
					if (i % 400 == 0) {
						printf("%d\n", i);
						n++;
					}
				} else
				{
					printf("%d\n", i);
					n++;
				}
			}
		}

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

		printf("\n\n");
	}
}

C++: #include <stdio.h>

int leap_year(int, int);

int main(void)
{
	int a, b;
	while (1) {
		scanf("%d %d", &a, &b);
		if (a == 0 && b == 0) 
			break;
		leap_year(a, b);
	}
	return 0;
}

int leap_year(int a, int b)
{
	int leap_year_number = 0;
	for (int i = a; i <= b; i++) {
		if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
			printf("%d\n", i);
			leap_year_number += 1;
		}
	}
	if (leap_year_number == 0) {
		printf("NA\n");
	}
	return 0;
        printf("\n\n");
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

bool check(int year)
{
  if(year%400 == 0 || (year%4 == 0 && year%100 != 0))
    return true;

  return false;
}

int main()
{
  int a, b;
  bool flg = false;

  while(cin>>a>>b && a+b){
    if(flg) cout << endl;

    flg = false;
    for(int year = a; year <= b; ++year){
      if(check(year)){
	cout << year << endl;
	flg = true;
      }
    }

    if(!flg) cout << "NA" << endl;
    flg = true;
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <set>
#include <cmath>
#include <map>
using namespace std;

bool isLeap(const int y){
	if(!(y%400)) return true;
	if(!(y%100)) return false;
	if(!(y%4)) return true;
	return false;
}

int main(int,char**){
	int a,b;
	bool ini(0);
	while(std::cin >> a>> b){
		if(!a&&!b) break;
		if(ini) cout <<endl;
		else ini=true;
		
		bool ex(0);
		for(int i(a);i<=b;++i){
			if(isLeap(i)) {
				cout << i <<endl;
				ex = true;
			}
		}
		if(!ex) cout << "NA" <<endl;
		
	}
	return 0;
}