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>
using namespace std;

bool uru(int y){
    return (y%4==0 && (y%100!=0 || y%400==0) )? true : false ;
}

int main(){
	int a,b;
	bool flag, iniFlag=false;
	
	while(1){
		cin >> a >> b;
		if(a==0 && b==0) break;
		if(iniFlag)cout << endl;
		iniFlag = true;
		flag = true;

		for(int i=a ; i<=b ; i++){
			if( uru(i) ){
				flag = false;
				cout << i << endl;
			}
		}
		if( flag ) 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 <stdio.h>
#include <stdbool.h>

int lpyrJudge(int x, int y);

int main(void)
{
    int sta, fin;
    while (true) {
        scanf("%d %d", &sta, &fin);
        if (sta == 0 && fin == 0) {
            break;
        } else {
            lpyrJudge(sta, fin);
        }
    }
    return 0;
}

int lpyrJudge(int x, int y)
{
    int minmod4x;   //x??\??????????°????4????????°
    if (x % 4 == 0){
        minmod4x = x;
    } else {
        minmod4x = x - x % 4 + 4;
    }
    if (y - minmod4x < 4) {
        printf("NA\n");
    } else {
        for (int i = minmod4x; i <= y; i = i + 4) {
            if (i % 100 == 0) {
                if(i % 400 == 0) {
                    printf("%d\n", i);
                } else {    //??????????????????????????????
                }
            } else {
              printf("%d\n", i);
            }
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    bool year[3000];
    for(int i=0;i<3000;i++)year[i]=false;
    for(int i=0;i<3000;i+=4)year[i]=true;
    for(int i=0;i<3000;i+=100)year[i]=false;
    for(int i=0;i<3000;i+=400)year[i]=true;
    int a,b;
    while(cin>>a>>b,a||b){
        bool f=true;
        for(int i=a;i<=b;i++){
            if(year[i]){
                cout<<i<<endl;
                f=false;
            }
        }
        if(f)cout<<"NA"<<endl;
        cout<<endl;
    }
    return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int a,b;
  int ans=0,k=0;
  while(cin>>a>>b){
    if(a==0&&b==0) break;
    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;
      }
      if(ans!=0&&ans!=k) cout << ans << endl;
      k = ans;    
    }
    if(ans==0) cout << "NA" << endl;
    cout << endl;
    ans = 0;
  }
  return 0;
}

C++: #include<stdio.h>

int leap_year(int x);


int main(void)
{
    int start_year, end_year, counter;
    check = 0;
    scanf(%d %d, &start_year, &end_year);
    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 <stdio.h>
#include <stdbool.h>

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

int main(void)
{ 
    while (true) {
        int x, y;
        bool exist = false;
        scanf("%d%d", &x, &y);
        if (x == 0 && y == 0) {
            break;
        }
        for (int i = x;i <= y; ++i) {
            bool flag = judge(i);
	    if (flag == true) {
                printf("%d\n", i);
                exist = true;
            } 
        }
        if (exist == 0) {
            printf("NA\n");
        }
    }   
    return 0;        
}

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

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int a,b;
    bool start=true;
    while(cin>>a>>b&&a){
        if(start){
            cout<<endl;
            start=false;
        }
        bool f=true;
        rep(i,a,b+1){
            int n=i;
            if(n%400==0){
                cout<<i<<endl;
                f=false;
            }
            else if(n%100&&n%4==0){
                cout<<i<<endl;
                f=false;
            }
        }
        if(f)cout<<"NA"<<endl;
        
    }

    return 0;
}

C++: #include<iostream>

using namespace std;


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

}

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

bool leap_year(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 main(void)
{
    int y_ini, y_fin;
    while(1) {
        int count = 0;
        scanf("%d %d", &y_ini, &y_fin);
    
        if (y_ini == 0 && y_fin == 0) {
            break;
        }

        for (int year = y_ini; year <= y_fin; year++) {
            if (leap_year(year) == true){
                printf("%d\n", year);
                count++;
            }
        }
        
        if (count == 0) {
            printf("NA\n");
        }
        
        printf("\n");
    }
            
    return 0;
}