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;

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

int main()
{
	solve();
	return(0);
}

C++: #include<stdio.h>
    
int leap_year(int x);
        
int main(void)
{
    int start_year, end_year, counter;
    while(1){
        scanf("%d %d", &start_year, &end_year);
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            counter = 0;
            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 && !(x % 100 == 0)) || x % 400 == 0){
        printf("%d\n", x);
        return 1;
    }else{
        return 0;
    }
}

C++: #include<stdio.h>
int miny,maxy;
int cou1=0,cou2=0;

int main()
{
    while(1)
    {
        scanf("%d%d",&miny,&maxy);
        if(miny==0&&maxy==0)break;
        if(cou2!=0)printf("\n");
        cou1=0;
        for(int i=miny;i<=maxy;i++)
        {
            if((i%4==0&&i%100!=0)||i%400==0)
            {
                printf("%d\n",i);
                cou1++;
            }
        }
        if(cou1==0)printf("NA\n");
        cou2++;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
bool chk(int n){
  return (n % 4 == 0) - (n%100 == 0) + (n%400 ==0);
}

int main(void){
  int a,b,res = 0;
  bool first = false;
  while(cin>>a>>b,a+b){
    bool used = false;
    if(first)cout<<endl;
    first = true;

    for(int i = a ; i <= b ; i ++)
      if(chk(i)){
	cout<<i<<endl;
	used = true;
      }
    if(!used)cout<<"NA"<<endl;
  }
}

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;
		printf("\n");

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

int main(void)
{
	int a, b;
	bool i = true;
	
	do{
		scanf("%d %d", &a, &b);
		while (a++ < b){
			if (a % 4 == 0 && a % 100 != 0 || a % 400 == 0){
				printf("%d\n", a);
				i = false;
			}
		}
		if (a != 0 && b != 0 && i == true){
			printf("NA\n");
		}
		i = true;
		if (a != 0 && b != 0){
			printf("\n");
		}
	}while (a != 0 && b != 0);
	
	return (0);
}

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

int main(void){
	bool first = true; //true : êÔÅ false:2ñÚÈ~

	while(1){
		int a,b;
		int count = 0;

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

		if(first == true){
			first = false;
		}
		else{
			cout<<endl;
		}

		for(int i=a;i<=b;i++){
			bool flg = false;
			//true : ¤é¤Çµ, false:¤é¤ÇµÅÈ¢

			if(i % 4 == 0){
				if(i % 100 == 0){
					if(i % 400 == 0) flg = true;
					else flg = false;
				}
				else{
					flg = true;
				}
			}

			if(flg == true){
				cout<<i<<endl;
				count++;
			}
		}

		if(count == 0){
			cout<<"NA\n";
		}
	}

	return 0;
}

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

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

int main(int argc, char const* argv[]) {
  int begin, end;
  bool tmp = true;
  while (true) {
    cin >> begin >> end;
    if (begin == 0 && end == 0) break;
    if (!tmp) cout << endl;
    if (tmp) tmp = false;

    bool flag = true;
    for (int i = begin; i <= end; i += 1) {
      if (i % 400 == 0) {
        flag = false;
        cout << i << endl;
        continue;
      }
      if (i % 4 == 0 && i % 100 != 0) {
        flag = false;
        cout << i << endl;
      }
    }
    if (flag) {
      cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include <stdio.h>

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

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

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 <stdio.h>

int isLeap(int y){
	if (y%4) return 0;
	if (y%100) return 1;
	if (y%400) return 0;
	return 1;
}

int main(void){
	int y1, y2;
	
	while (scanf("%d%d",&y1, &y2),y1){
		int isNA = 1;
		for (int i=y1; i<=y2; i++){
			if (isLeap(i)){
				printf("%d\n", i);
				isNA=0;
			}
		}
		if (isNA) puts("NA");
		puts("");
	}
	printf("\b");
	return 0;
}

C++: #include <iostream>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


int main(void){

int a,b,sp=0;
	
	while(cin >> a >> b){
		if(a==0  && b==0 || cin.eof()) break;
		int cnt=0;
		if(sp != 0) cout << endl;
		while(1){
			if(a%400 == 0 || a%100 != 0 && a%4 == 0 ){
				cout << a << endl;
				cnt++;
			}
			a++;
			if(a > b) break;
		}	
		if(cnt==0) cout << "NA" << endl;
		sp = 1;
	}
	return 0;
	
}