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

int main(void)
{
    
    int start_year, end_year;
    scanf("%d %d", &start_year, &end_year);
    Leap_Year(start_year, end_year);
    return 0;
}

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

int y[3001];

int main()
{
  for (int i = 4; i <= 3000; i += 4){
    y[i] = 1;
  }
  for (int i = 100; i <= 3000; i += 100){
    y[i] = 0;
  }
  for (int i = 400; i <= 3000; i += 400){
    y[i] = 1;
  }
  
  int a, b;
  while (1){
    cin >> a >> b;
    if (a == 0){
      break;
    }
    int c = 0;
    cout << endl;
    for (int i = a; i <= b; i++){
      if (y[i] == 1){
        cout << i << endl;
        c = 1;
      }
    }
    if (c == 0){
      cout << "NA" << endl;
    }
  }
  
  return 0;
}

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

bool judge(int year);

int main() 
{
	int a, b;
	
	while (true) {
		int check = 0;
		std::cin >> a >> b;
		
		if (start == 0 && end == 0) {
			break;
		}
		
		for (int i = a; i <= b; i++) {
			if (judge(i)) {
				std::cout << i << std::endl;
				check = 1;
			}
		}
		
		if (check == 0) {
			std::cout << "NA" << std::endl;
		}
		
		std::cout << std::endl;
	}
	return 0;
}


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

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

void leapyear (int year1, int year2)
{
    int i;
    int j = 0; 
    for (i = year1; i <= year2; ++i) {
        if (i % 4 == 0) {
            if (i % 100 != 0) {
                printf("%d\n", i);
                ++j;
            } else if (i % 400 == 0) {
                printf("%d\n", i);
                ++j;
            } 
        }
    }
    if (j == 0) {
        printf("NA\n");
    }
    printf("\n");
}

int main(void)
{
    while (true) {
        int year1, year2;
        scanf("%d %d", &year1, &year2);
        if (year1 == 0 && year2 == 0) {
            break;
        }
        leapyear(year1, year2);
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int a,b,c;
int main(){
	cin>>a>>b;
	while(1){
		c=1;
		for(int i=a;i<=b;i++){
			if(i%4==0&&(i%100>0||i%400==0)){
				cout<<i<<endl;c=0;
			}
			
		}
		if(c)cout<<"NA"<<endl;
		cin>>a>>b;
		if(a==0&&b==0)break;
		else cout<<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 << endl << "NA" <<endl;
    }
    
    cin >> a >> b;
    cout << endl;
  } 

}

C++: #include <bits/stdc++.h>                                            
                                                                    
using namespace std;                                                
                                                                    
int main() {                                                        
                                                                    
    int a, b, isNA, isData= 0;                                      
                                                                    
    while(cin >> a >> b && (a || b)) {                              
                                                                    
        if(isData == 0) {                                           
            isData = 1;                                             
        } else {                                                    
            cout << endl;                                           
        }                                                           
                                                                    
        isNA = 1;                                                   
                                                                    
        for(int i = a; i <= b; ++i) {                               
            if(i == 0) {                                            
                continue;                                           
            }                                                       
            if(i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {      
                cout << i << endl;                                  
                isNA = 0;                                           
            }                                                       
        }                                                           
                                                                    
        if(isNA == 1) {                                             
            cout << "NA" << endl;                                   
        }                                                           
                                                                    
    }                                                               
                                                                    
}

C++: #include <stdio.h>

int leapyear(int y){
    if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)return 1;
        else return 0;
}

int main(void){
    int a,b,count,first=1;
    while(scanf("%d %d",&a,&b) != EOF && ( a != 0 || b != 0)){
        count=0;
        if(first == 0)printf("\n");
        for(int y = a;y <= b;y++){
            if(leapyear(y) == 1){
                printf("%d\n",y);
                count++;
            }
        }
        if(count == 0)printf("NA\n");
        first=0;
    }
    return 0;
}

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

int main(){
	int a,b;
	bool f1,f2=true;
	
	while(1){
		f1=false;
		cin>>a>>b;
		if(a==0&&b==0)break;
		f2?f2=false:cout<<endl;
		for(int i=a;i<=b;i++){
			if(i%4==0){
				if(i%100==0){
					if(i%400==0){
						cout<<i<<endl;
						f1=true;
					}
				}
				else
				{
					cout << i << endl;
					f1=true;
				}
			}
		}
		f1?f1:cout <<"NA" << endl;
	}
	return 0;
}