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>
    
int leap_year(int x);
        
int main(void)
{
    int start_year, end_year, counter;
    while(1){
        scanf("%d %d", &start_year, &end_year);
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            counter = 0;
            for(int i = start_year; i <= end_year; i++){
                counter += leap_year(i); 
                }
            if( counter == 0){
                printf("NA\n");
            }
        }
    }
    return 0;
}
    
    
int leap_year(int x)
{
    if((x % 4 == 0 && !(x % 100 == 0)) || x % 400 == 0){
        printf("%d\n", x);
        return 1;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int a,b;
	int q=false;
	while(cin>>a>>b,a||b){
		if(q)cout<<endl;
		q=true;
		bool h=false;
		loop(i,a,b+1)if(i%400==0||(i%100&&i%4==0)){
			h=true;
			cout<<i<<endl;
		}
		if(!h)cout<<"NA"<<endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(){

	int a,b;

	while(1){

		int count = 0;

		cin >> 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){
				cout << i << endl;
				count++;
			}

		}

		if(count == 0){
			cout << "NA" << endl;
		}

		cout << endl;
	}

	cout << endl;

	return 0;
}

C++: #include <iostream>

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) 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>
int main(){
    int a,b,i,memory[3000]={0},cnt=0;
    while(1){
        scanf("%d %d",&a,&b);
        if(a==0&&b==0) break;
        for(i=a;i<=b;i++){
            if(i%400==0){
                memory[cnt]=i;
                cnt++;
            }else if(i%100!=0&&i%4==0){
                memory[cnt]=i;
                cnt++;
            }
        }
        if(cnt!=0){
            for(i=0;i<cnt;i++){
                printf("%d\n",memory[i]);
                memory[i]=0;
            }
        }else{
            puts("NA");
        }
        cnt=0;
    }
    return 0;
}

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

int main() {
	int a, b;
	bool first = true;
	for (cin >> a >> b; a && b; cin >> a >> b) {
		if (first) {
			first = !first;
		}
		else {
			cout << endl;
		}
		vector<int> years;
		int i;
		for (i = a; i < b; ++i) {
			if (i % 400 == 0 || (i % 4 == 0 && i % 100)) {
				years.push_back(i);
				break;
			}
		}
		for (i += 4; i < b; i += 4) {
			if (i % 100 || i % 400 == 0) {
				years.push_back(i);
			}
		}
		if (years.empty()) {
			cout << "NA" << endl;
		}
		else {
			for (int i = 0; i < years.size(); ++i) {
				cout << years[i] << endl;
			}
		}
	}
	return 0;
}

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

int judge(int n){
  int flg = 0;
  if(n%4 == 0) flg = 1;
  
  if(n%400==0) flg = 2;

  if(flg == 2){
    if(n%100 == 0) return 0;
    return 1;
  }
  else if(flg == 1) return 1;

  return 0;
}

int main(){
  int f,e;

  while(1){
    int cnt = 0;
    cin >> f >> e;
    if(f == 0 && e == 0) break;

    for(int i = f ; i <= e ; i++){
      if(judge(i)){
        cout << i << endl;
        cnt++;
      }
    }
    if(cnt == 0) cout << "NA" << endl;
    cout << endl;
  }

  return 0;
}

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

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

int main()
{
	int a, b;
	while(cin >> a >> b){
		if(!a && !b) break;
		bool flag = false;
		for(int i=a; i<=b; i++){
			if(is_reap(i)){ cout << i << endl; flag = true;}
		}
		if(!flag) cout << "NA" << endl;
		cout << endl;
	}
	return 0;
}

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

int main() {
  int from,end,check,c=0;
  while(cin >> from >> end) {
    check = 0;
    if((from == 0) && (end == 0)) break;
    if(c != 0) cout << endl;
    for(int i=0;i<end - from + 1;i++) {
      if((from + i) % 4 == 0) {
        if((from + i) % 100 == 0) {
          if((from + i) % 400 == 0) {
            cout << from + i << endl;
            check = 1;
          }
        }
        else {
          cout << from + i << endl;
          check = 1;
        }
      }
    }
    if(check == 0)
      cout << "NA" << endl;
    c = 1;
  }
}

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

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


void judging(int x, int y)  //start,end
{
    int count = 0;  //count the number of non-leap-year
    for (int j = x; j <= y; j++) {
        if (j % 400 == 0) {
            std::cout << j << std::endl;
        } else if (j % 100 == 0) {
            count++;
        } else if (j % 4 == 0) {
            std::cout << j << std::endl;
        } else {
            count++;
        }
    }
    if (count == y - x + 1) {
        std::cout << "NA" << std::endl;
    }
    return;
}


int main()
{
    std::vector<std::pair<int, int>> year(100);  //start,end(size of vector is temporary)
    int size = 0;                                //current array subscript
    std::cin >> year[size].first >> year[size].second;
    while (year[size].first != 0 || year[size].second != 0) {
        size++;
        std::cin >> year[size].first >> year[size].second;
    }
    for (int i = 0; i < size - 1; i++) {
        judging(year[i].first, year[i].second);
        std::cout << std::endl;
    }
    judging(year[size - 1].first, year[size - 1].second);
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,count;
  while(cin >>a>>b){
    count=0;
    if(a==0&&b==0)break;
    for(int i=a;i<=b;i++){
      
      if(i%4==0){

	if(i%400==0){
	  cout <<i<<endl;count++;}
      else if( i%100!=0){
	cout <<i<<endl;count++;}
    
      }
      if(i==b && count==0)cout<<"NA"<<endl;
    }
	
    cout <<endl;
  }
  return 0;

      
  }