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>

void leapYear(int, int);
int main()
{
    while (true) {
        int a, b;
        std::cin >> a >> b;
        if (a == 0 && b == 0) {
            break;
        }
        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 uruu(int i){
  if(i%4!=0)return 0;
  else if(i%400==0)return 1;
  else if(i%100==0)return 0;
  return 1;
}

int main(){
  int a,b,k=11111;
  while(1){
    cin>>a>>b;
    if(a==0)break;
    if(k!=11111)cout<<endl;
    k=0;
    for(int i=a;i<=b;i++){
      if(uruu(i)){k++;cout<<i<<endl;}
      
    }
    if(k==0)cout<<"NA"<<endl;
  }
  return 0;
}

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

int main(){
  queue<int> year;
  int a,b,cou,count,tmp,i;
  while(1){
    cin >> a >> b;
    if(a == 0 && b == 0) break;
    cou = b - a + 1;
    for(i=0;i<cou;i++){
      tmp = a + i;
      if(tmp%4 == 0 && tmp%100 != 0 || tmp%400 == 0){
	year.push(tmp);
      }
    }
    count = year.size();
    if(count == 0){
      cout << "NA" << endl;
    }
    else{
      for(i=0;i<count;i++){
	cout << year.front() << endl;
	year.pop();
      }
    }
    cout << endl;
  }
}

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<cstdio>
using namespace std;
int main()
{
    int a,b;
    int f = 0;
    int ans[2000] = {0};
    int cnt = 0;
    int j = 0;
    for(;;){
        if(f == 0)cin >> a >> b;
        if(a == 0 && b == 0)break;
        for(int i = a; i <= b; i++){
            if(i%4 == 0 && i%100 != 0){cnt++;ans[j] = i;j++;}
            else if(i%400 == 0){cnt++;ans[j] = i;j++;}
        }
        if(cnt == 0)printf("NA\n");
        else {
            for(int i = 0;i < j; i++)printf("%d\n",ans[i]);
            j = 0;
            cnt = 0;
        }
        if(f == 1)printf("\n");
        if(f == 0){printf("\n");f = 1;}
        if(f == 1)cin >> a >> b;
    }
    return 0;
}

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

int start, end;
int ans[800], count;
int cont = 0;
int main(){
	while(cin >> start >> end, start || end){
		if(cont != 0) cout << endl;
		count = 0;
		for(; start <= end; start++){
			if(start % 4 == 0){
				if(start % 100 == 0){
					if(start % 400 == 0){
						ans[count] = start;
						count++;
					}
				}
				ans[count] = start;
				count++;
			}
		}
		if(count == 0) cout << "NA" << endl;
		else{
			for(int i=0; i < count; i++){
				cout << ans[i] << endl;
			}
		}
		cont++;
	}
}

C++: #include <iostream>

int main()
{
	int a, b;
	bool ff = false;
	
	while ((std::cin >> a >> b) && (a || b)) {
		if (ff) {
			std::cout << std::endl;
		} else {
			ff = true;
		}
		bool f = true;
		for (int y = a; y <= b; ++y) {
			if ((!(y % 4) && (y % 100)) || !(y % 400)) {
				std::cout << y << std::endl;
				f = false;
			}
		}
		if (f) std::cout << "NA" << std::endl;
	}
	
	return 0;
}

C++: #include <stdio.h>

int main(void) {

  int a,b;
  int i,flag;

  while(1) {

    scanf("%d %d",&a,&b);

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

    flag=0;

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

    }

    if(flag==0) printf("NA\n");

    printf("\n");
  }

  printf("\n");

  return 0;

}

C++: #include <stdio.h>

int main(void)
{
    int a, b, year, answer, i;
    i = 0;
    while(1) {
	scanf("%d %d", &a, &b);
	if (a == 0 && b == 0) {
	    break;
	}
	if (i != 0) {
	    pritnf("\n");
	}
	i++;
	answer = 0;
	for (year = a; year <= b; year++) {
	    if (year % 4 == 0) {
		if (year % 100 != 0) {
		    printf("%d\n", year);
		    answer++;
		} else if (year % 400 == 0) {
		    printf("%d\n", year);
		    answer++;
		}
	    }
	}
	if (answer == 0) {
   	    printf("NA\n");
	}
    }
    return 0;
}

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

int main()
{
	int syear,eyear;
	while(cin >> syear && cin >> eyear){
		if(syear == 0)
			break;
		bool flag = false;
		for(int i=syear;i<=eyear;i++){
			if(i%4==0){
				if(i%400==0){
					flag = true;
					cout << i << endl;
				}
				else if(i%100==0){
				}
				else{
					flag = true;
					cout << i << endl;
				}
			}
		}
		if(flag==false)
			cout << "NA" << endl;
	}
	return 0;
}

C++: #include <stdio.h>
 
int start, end, year, answer, i;

int years(void)
{
     if (year % 4 == 0) {
        if (year % 100 != 0) {
            printf("%d\n", year);
            answer++;
        } else if (year % 400 == 0) {
            printf("%d\n", year);
            answer++;
        }
      }
}

int main(void)
{
    i = 0;
    while(1) {
    scanf("%d %d", &start, &end);
    if (start == 0 && end == 0) {
        break;
    }
    if (i != 0) {
        printf("\n");
    }
    i++;
    answer = 0;
    for (year = start; year <= end; year++) {
        years();
    }
    if (answer == 0) {
        printf("NA\n");
    }
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>

using namespace std;

int main()
{
  int a, b;
  int c = 0;
  
  while ( cin >> a >> b )
    {
      if ( a == 0 && b == 0 ) break;
      
      vector<int> ret;

      for ( auto y = a; y <= b; ++y )
        {
          if ( y % 400 == 0 || ( y % 100 != 0 && y % 4 == 0 ) )
            ret.push_back( y );
        }

      if ( c++ ) cout << endl;

      if ( ret.size() == 0 )
        cout << "NA" << endl;
      else
        for ( auto it = ret.begin(); it != ret.end(); ++it )
          cout << *it << endl;
    }
  
  return 0;
}