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

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

int main(){
    bool tf = false;
    int a,b;
    
    for(;;){
        int flg = 0;
        cin >> a >> b;
        if(a == 0 && b == 0) break;
        
        if(tf) puts("");
        else tf = true;
        
        for( ; a <= b ; a++){
            if(!(a%4)){
                if(!(a%100)){
                    if(!(a%400)){
                        flg = 1;
                        cout << a << endl;
                    }
                }
                else{
                    flg = 1;
                    cout << a << endl;
                }
            }
        }
        if(!flg) cout << "NA" << endl;
    }
    
    return 0;
}

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

C++: #include <stdio.h>

int leap_year(int first_year, int last_year);

int main(void)
{
    int first_year, last_year;
    scanf("%d %d", &first_year, &last_year);
    while (1) {
        if (first_year == 0 && last_year == 0) {
            break;
        } else {
            leap_year(first_year, last_year);
            printf("\n");
            scanf("%d %d", &first_year, &last_year);
        }
    }
    return 0;
}

int leap_year(int first_year, int last_year)
{
    int count = 0;
    for (int year = first_year; year <= last_year; ++year) {
        if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
           printf("%d\n", year);
        } else {
            ++count;
        }
    }
    if (count == last_year - first_year + 1) {
        printf("NA\n");
    }
    return 0;
}

C++: #include<stdio.h>

void leap_year(int start_year, int end_year);

int main(void)
{
 int start_year;
 int end_year;
   while(1){
   scanf("%d %d", &start_year, &end_year);
   if (start_year == 0 && end_year == 0) {
     break;
  } else {
   leap_year(start_year, end_year);
   printf("\n");
   }
   }
   return 0;
}

void leap_year(int start_year, int end_year)
{
 int n = 0;
 int year = start_year;
   while (year <= end_year){
     if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)){
     printf("%d\n", year);
     n++;
   }
     year++;
 }
 if (n == 0){
   printf("NA\n");
  }
}

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

using namespace std;

typedef long long ll;

#define ITER( c ) __typeof( c ).begin()
#define REP( i, m, n ) for ( int i = m; i < n; i++ )
#define UREP( i, m, n ) for ( unsigned int i = m; i < n; i++ )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) c.begin(), c.end()
#define PB( n ) push_back( n );
#define MP( a, b ) make_pair( a, b )
#define fst first
#define snd second

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

	return false;
}

int main()
{
	int a, b;

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

		bool be = false;

		for ( int i = a; i <= b; i++ )
		{
			if ( leap( i ) )
			{
				be = true;
				cout << i << endl;
			}
		}

		if ( !be )
		{
			cout << "NA" << endl;
		}

		cout << endl;
	}

	return 0;
}

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

int main(void)
{
  int a, b;
  int flag;
  
  while(1)
    {
      cin >> a >> b;
      if(a == 0 && b == 0) break;
      flag = 0;

      for(int i = a ; i <= b ; i++)
	{
	  if(i % 4 == 0 && i % 400 != 0 || i % 100 == 0) 
	    {
	      cout << i << endl;
	      flag = 1;
	    }
	}
      if(flag == 0) cout << "NA" << endl;
    }
  return 0;
}

C++: #include <iostream>


int leap_year(int y) {
	if( y % 400 == 0) {
		return 1;/*???????????´*/
	} else if (y % 100 == 0 && y % 400 != 0) {
		return 0;/*???????????´??§??????*/
	} else if (y % 4 == 0 && y % 100 != 0) {
		return 1;
	} else {
		return 0;
	}
}
int main()
{
	int a;
	int b;
	while (true) {
		std::cin >> a >> b;
		if (a == 0 && b == 0) {
			break;
		} else {
			int sum = 0;
			for (int k = a; k <= b; k++) {
				sum = sum + leap_year(k);
			}
			if (sum == 0 /*????????????????????´?????????*/) {
				std::cout << "NA" << std::endl;
			} else {
			    for (int i =a; i <= b; i++) {
					if (leap_year(i) == 1) {
						std::cout << i << std::endl;
					}
				}
			}
			std::cout << std::endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(){

	int a,b;
	int i;
	int answer;
	int count;
	int j = 1;

	while(scanf("%d %d",&a,&b),a,b){
		count = 0;

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

	return 0;
}

C++: #include <stdio.h>
  int main(){
	   int a,b;
	  scanf("%d%d",&a,&b);
while(1){
int i,sum=0;
for(i=a;i<=b;i++){
if(i%400==0){
printf("%d\n",i); sum++;
}else if(i%100==0){
continue;
}else if(i%4==0){
printf("%d\n",i);sum++;
}}
if(sum==0) printf("NA\n");
sum=0;
scanf("%d%d",&a,&b);
if(a==0 && b==0) break;
}
return 0;
}

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

int main(){
    int A=-1,B=-1;
    while(cin>>A>>B, A||B){
        if(A!=-1 && B!=-1) puts("");
        bool no = true;
        for(int i=A;i<=B;i++){
            if(i%4==0 && (i%100!=0 || i%400==0)) printf("%d\n",i), no = false;
        }
        if(no) puts("NA");
    }
    return 0;
}