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 leap_year(int x, int y)
{
    int z = 0;
    while (x <= y) {
        if (((x % 4 == 0) && (x % 100 != 0)) || (x % 400 == 0)) {
            printf("%d\n", x);
            z += 1;
        }
        x += 1;
    }
    if (z == 0) {
        printf("NA\n");
    }       
}

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    if (!(a == 0 && b == 0)) { 
        leap_year(a, b);
        }
    scanf("%d %d", &a, &b);
    while(!(a == 0 && b == 0)) {
        printf("\n");
        leap_year(a, b);
        scanf("%d %d", &a, &b);
    }
    return 0;
}

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

bool isLeapYear(int y);
int main(){
  int a,b;
  vector<int> A,B;
  while(1){
    cin>>a>>b;
    if(a<0||b<0||a>b||a>3000||b>3000)
      return 1;
    if(a==0&&b==0)
      break;
    A.push_back(a),B.push_back(b);

  }
  for( int i=0;i<A.size();i++ ){
    int leapnum=0;
    for( int j=A[i];j<=B[i];j++ ){
      if(isLeapYear(j)){
	leapnum++;
	cout<<j<<endl;
      }
    }
    if(!leapnum){
      cout<<"NA"<<endl;
    }
    cout<<endl;
  }
  return 0;
}

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

C++: #include <iostream>

int main() {
    int a, b, n = 0;
    std::cin >> a >> b;
    while (a????????????0 && b != 0) {
        for (int i = a, i <= b, ++i) {
            if (i % 400 == 0) {
                std::cout << i << std::endl;
                n += 1;
            } else if (i % 100 != 0 && i % 4 == 0) {
                std::cout << i << std::endl;
                n += 1;
            } else  {
                continue;
            }
        }
        if (n == 0) {
            std::cout << "NA" << std::endl;
        }
        std::cin >> a >> b;
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<double,double> P;



int main(){
	int n,m;
	vector<vector<int> > ans;
	while(~scanf("%d %d",&n,&m)){
		if(n==m && n==0) break;
		
		vector<int> tmp;
		for(int i=n;i<=m;i++){
			bool isok = i % 400 == 0 
				? true : i % 100 == 0
				? false : i % 4 == 0
				? true : false;

			if(isok){
				tmp.push_back(i);
			}
		}

		ans.push_back(tmp);
	}

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

		if(ans[i].size() == 0)
		{
			cout << "NA" << endl;
		}

		printf("%s",i==ans.size()-1 ? "" : "\n");
	}
}

C++: #include <iostream>

int leap_year(int year)
{
	if ( year % 4 == 0) {
		if ( year % 100 == 0) {
			if ( year % 400 == 0) {
				return 1;
			} else {
				return 0;
			}
		} else {
			return 1;
		}
	} else {
		return 0;
	}
}

int main()
{
	int a, b;
	
	while (true) {
		std::cin >> a >> b;
		if (a == 0 && b == 0) {
			break;
		} else {
			int i = 0;
			for (int j = a; j <= b; j++) {
				if (leap_year(j) == 0) {
					i++;
				} else {
					std::cout << j << std::endl;
				}
			}
			if ( i == a - b + 1) {
				std::cout << "NA" << std::endl;
			}
		}
		std::cout << std::endl;
	}
	
	return 0;
}

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

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

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

using namespace std;

void uru(int c, int d) {
	int counter = 0;

	for (int i = c; i <= d; i++) {
		if (i % 4 == 0) {
			if (i % 100 == 0) {
				if (i % 400 == 0) {
					cout << i << endl;
					counter++;
				} 
			} else {
				cout << i << endl;
				counter++;
			}
		}
	}
	if (counter == 0) {
		cout << "NA" << endl;
	}
	cout << endl;
	return;
}

int main() {
	int a,b;

	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			break;
		} else {
			uru(a,b);
		}
	}
	return 0;
}

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

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

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

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define sz(obj) ((int)(obj).size())
#define pb push_back

int main()
{
  int a, b;
  while (cin >> a >> b, a + b){
    vector<int> v;
    FOR(i, a, b + 1){
      if (i % 400 == 0) v.pb(i);
      else if (i % 4 == 0 && i % 100 != 0) v.pb(i);
    }
    if (sz(v)) REP(i, sz(v)) cout << v[i] << endl;
    else cout << "NA" << endl;
  }
}

C++: #include<stdio.h>
int main(){
	int year;
	int s,l,i,j=0,k=0,m=0,flag=0,ans[300][300]={0};
	
	while(scanf("%d%d",&s,&l)!=EOF){
		if(s==0 && l==0)break;
	for(i=s;i<=l;i++){
		if(i%4==0){
			if(i%100!=0 || i%400==0){
			ans[j][k]=i;
			flag=1;
				k++;
			}
		}
	}
	if(flag==0)ans[j][k]=-10;
		flag=0;
		j++;
		k=0;
	}
	
	for(i=0;i<j;i++){
		for(k=0;;k++){
			if(ans[i][k]!=-10){
				if(ans[i][k]==0)break;
				printf("%d\n",ans[i][k]);
			}
		else printf("NA\n");
		}
		printf("\n");
	}
return 0;
}