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 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);
        printf("\n");
    }
    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<iostream>
#include<vector>
using namespace std;

bool leap(int x) {
	int flg=0;
	if (x % 4 == 0) { flg = 1; }
	if (x % 100 == 0) { flg = 0; }
	if (x % 400 == 0) { flg = 1; }

	return flg;
}

int main() {
	int a, b;
	vector<int>va;
	while (cin >> a >> b, a, b) {
		for (int i = a; i <=b; i++) {
			int c = leap(i);
			if (c==1) { va.push_back(i); }
		}
		if (!va.empty()) {
			for (int i = 0; i < va.size(); i++) {
				cout << va[i] << endl;
			}
		}
		else { cout << "NA" << endl<<endl; }
		va.erase(va.begin(), va.end());
	}
	return 0;
}

C++: #include <iostream>

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

C++: #include <iostream>

using namespace std;

int main(){
	int a,b;
	int line =0;
	while(cin >> a >> b){
		if(a==0 && b==0) break;
		int count=0;
		if(line !=0) cout << "\n"; line++; 
		for(int i=a; i < b; i++){

			if(i%4==0){
    			if(i%100!=0){
      				cout << i << endl;
      				count++;
    			}
    		}
   	 		else if(i%400==0){
      			cout << i << endl;
      			count++;
    		}
			
		}
		if(count==0) cout << "NA\n";
	}

	return 0;
}

C++: #include <stdio.h>

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

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int n,m;
	int c = -1;
	while(cin>>n>>m,n||m){
		bool flag =false;
		if(c!=-1)cout <<endl;
		for(int i=n;i <=m;i++){
			c++;
			if((i%4==0&&i%100!=0)||(i%400==0)){
				flag =true;
				cout <<i<<endl;
				continue;
			}
		}
		if(!flag){
			cout <<"NA"<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(){
  int i, a, b, leap, count=0;
  vector<int> leapyear;

  while(1){
    cin >> a >> b;
    if(a == 0 && b == 0) break;
    else if(count != 0) cout << endl;

    for(i=a; i<=b; ++i){
      if(i%400 == 0)
	leap = 1;
      else if(i%100 == 0)
	leap = 0;
      else if(i%4 == 0)
	leap = 1;
      else
	leap = 0;

      if(leap == 1)
	leapyear.push_back(i);
    }

    if(leapyear.size() == 0){
      cout << "NA" << endl;
    }else{
      for(vector<int>::size_type i=0; i != leapyear.size(); ++i)
	cout << leapyear[i] << endl;
    }

    leapyear.clear();
    ++count;
  }

  return 0;
}

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

int main(){
	int year[3001];
	for(int i=0;i<3001;i++){
		if(i%4==0){
			year[i]=1;
		}else year[i]=0;
		if(i%100==0){
			year[i]=0;
		}
		if(i%400==0){
			year[i]=1;
		}
	}
	int a,b;
	cin>>a>>b;
	int cnt=0;
	if(a==0 && b==0)goto LABEL;
	for(int j=a;j<=b;j++){
		if(year[j]==1){
			cout<<j<<endl;
			cnt++;
		}
	}
	if(cnt==0)cout<<"NA"<<endl;
	while(1){
		cnt=0;
		cin>>a>>b;
		if(a==0 && b==0){
			break;
		}else{cout<<endl;}
		for(int j=a;j<=b;j++){
			if(year[j]==1){
				cout<<j<<endl;
				cnt++;
			}
		}
		if(cnt==0)cout<<"NA"<<endl;
	}
	LABEL:
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
 

int main() {
  int a,b;
  int s = 0;
  while(cin>>a>>b,a+b) {
    int f = 0;
    if (s)
      cout << endl;
    else
      s++;
    for(int i=a;i<=b;i++) {
      if (i%4==0&&i%100!=0 || i%400==0) {
        cout << i << endl;
        f++;
      }
    }
    if (f==0) cout << "NA" << endl;
  }
}

C++: #include <iostream>

bool judgeUruyear(int year)
{

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

}
int a=1;
void printUruyear(int year_begin, int year_end)
{
if(a==0){
std::cout << std::endl;}a=0;
    int count_year = 0;

    // kono for loop no jyouken-siki ha "=" hituyou
    for (int i = year_begin; i <= year_end; i++) {
        
        if (judgeUruyear(i)) {

            count_year += 1;
            std::cout << i << std::endl;
        }    
    }

    if (count_year == 0) { 
        std::cout << "NA" << std::endl;

    
    }
    
}

int main()
{
    int year_begin, year_end;

    for (; true;) {

        std::cin >> year_begin >> year_end;

        if (year_begin == 0 && year_end == 0) {
            break;
        }

        printUruyear(year_begin, year_end);
    }
    
    return 0;
}