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

int main(){
    int a, b;
    bool flag=false;
    bool ini=false;
    while(1){
        flag = false;
        cin >> a >> b;
        if(ini)cout << endl;
        else ini = true;
        if(a == 0 && b == 0) break;
        for(int y = a; y<=b; y++){
            if(y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)){
                flag = true;
                cout << y << endl;
            }
        }

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

    return 0;
}

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>
#include<stdio.h>
using namespace std;

int main()
{
    int a,b,year,flag;
    int i = 50,j;
    while(scanf("%d %d",&a,&b) && (a!=0 && b !=0) &&(i--))
    {
        flag = 0;
        for(j=a; j<=b; j++)
        {
            if((j%4 == 0 && j%100 != 100) || j%400 ==0 ) {
                cout << j << endl;
                flag = 1;
            }

        }
        if(flag != 1)
            cout << "NA" << endl;
    }
    return 0;
}

C++: #include <stdio.h>

void print_na(int a, int b);
void leap_year(int a, int b);

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    while ( a != 0 || b != 0) {
        printf("\n");
        print_na(a, b);
        leap_year(a, b);
        scanf("%d %d", &a, &b);
    }
    printf("\n");
    return 0;
}

void print_na(int a, int b)
{
    for (int i = a; i <= b; i++) {
        if ((i % 4 == 0 && !(i % 100 == 0)) || i % 400 == 0) {
            return;
        }
    }
    printf("NA\n");
}

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

C++: #include <stdio.h>

int hantei(int year);
//???????????´????????????????????????????????????

int main(void)
{
	int year[2];
	int NA;
	for(;;) {
		scanf("%d %d", &year[0], &year[1]);
		if(year[0] == 0 && year[1] == 0) {
			break;
		}
		NA = 0;
		for(int i = year[0]; i <= year[1]; i++) {
			if(hantei(i) == 1) {
			printf("%d\n", i);
			NA++;
			}
		}
		if(NA == 0) {
			printf("NA\n");
		}
		printf("\n");
	}
	return 0;
}

int hantei(int year)
{
	if(year % 400 == 0) {
		return 1;
	}else if(year % 100 == 0) {
		return 0;
	}else if(year % 4 == 0) {
		return 1;
	}else{
		return 0;
	}
}

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;
	}

	return 0;
}

C++: #include<stdio.h>
#include<stdbool.h>
//declare function                                                              
bool judgelpyear(int fstyear,int lastyear);

/*==============end of delaration====================================*/

int main(void){
    int fstimp;//first imput                                                    
    int secimp;//second imput                                                   
    do {
        scanf("%d %d", &fstimp, &secimp);
    }while(judgelpyear(fstimp, secimp) == true);
    return 0;
}

bool judgelpyear(int fstyear,int lastyear) {
    static bool judgefst;
    bool discovery = false;//if he can discover a leap year                     

    if(fstyear == 0 && lastyear == 0){
        return false;//end main                                                 
    }
    if(judgefst == true) {//make a space between outputs                        
        printf("\n");
    }

    for(int i = fstyear; i <= lastyear; i++) {
        if(i % 4 == 0 && (i % 100 != 0 || i % 400 == 0)) {
            printf("%d\n", i);
            discovery = true;//he discovered at least one leap year             
        }
    }
    if(discovery == false) {
        printf("NA\n");
    }

    judgefst = true;//he did this function at least one time                    
    return true;//repeat scanning years                                         
}

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

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

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

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int leepyear[1000][745] = {0};
    int i,j=0,k = 0,l=0,m = 0,n= 0;
    int yearA,yearB;
    int checyear = 0;

    while(cin >> yearA >> yearB,yearA+yearB)
    {
        FOR(i, yearA, yearB+1)
        {
            checyear = i;
            if(checyear % 400 == 0)
            {
                leepyear[j][k] = checyear;
                k++;
                
            }else if((checyear % 4 == 0) && (checyear % 100 != 0))
            {
                leepyear[j][k] = checyear;
                k++;
            }
        }
        k = 0;
        j++;
    }
    REP(l, j)
    {
        n = 0;
        if(leepyear[l][0])
        {
            while (leepyear[l][n])
            {
                cout << leepyear[l][n] << endl;
                n++;
                
            }
            cout << endl ;
        }
        else cout << "NA" << endl << endl;
    }
    
    return 0;
}

C++: #include <stdio.h>

void print_na(int a, int b);
void leap_year(int a, int b);

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    while ( a != 0 || b != 0) {
        printf("\n");
        print_na(a, b);
        leap_year(a, b);
        printf("\n");
        scanf("%d %d", &a, &b);
    }
    return 0;
}

void print_na(int a, int b)
{
    for (int i = a; i <= b; i++) {
        if ((i % 4 == 0 && !(i % 100 == 0)) || i % 400 == 0) {
            return;
        }
    }
    printf("NA\n");
}

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