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 is_leap(int y) {
  if(y % 400 == 0) {
    return true;
  }else if(y % 100 == 0) {
    return false;
  }else if(y % 4 == 0) {
    return true;
  }

  return false;
}

int main() {
  int a, b;

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

    bool flg = false;
    for(int i = a; i <= b; i++) {
      if(is_leap(i)) {
        cout << i << endl;

        flg = true;
      }
    }
    if(!flg) {
      cout << "NA" << endl;
    }
    cout << endl;

  }

  return 0;
}

C++: #include<stdio.h>

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

C++: 

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
bool uru[3000];

void q93() {
	memset(uru, 0, sizeof(uru));
	for (int i = 0; i < 3000; i += 4) {
		uru[i] = true;
	}
	for (int i = 0; i < 3000; i += 100) {
		uru[i] = false;
	}
	for (int i = 0; i < 3000; i += 400) {
		uru[i] = true;
	}

	int a, b;
	for (; cin >> a >> b;) {
		if (a == b && !a) break;
		bool print_flag = false;
		for (int i = a; i <= b; i++) {
			if (uru[i]) {
				cout << i << endl;
				print_flag = true;
			}
		}
		if (!print_flag) cout << "NA" << endl;
		cout << endl;
	}
}
int main() {
	q93();
	return 0;
}

C++: #include <stdio.h>

int count_number(void);

int main(void)
{
    
    int a[15];//15は適当　要素数はわからないが配列を作りたかった
    int b[15];
    int dataset_number = 0;
    while (1) {
        scanf("%d %d", &a[dataset_number], &b[dataset_number]);
        if (a[dataset_number] == 0 && b[dataset_number] == 0) {
            break;
        }
        dataset_number++;
    }
    int j = 0;
    while(j < dataset_number){
        int leapyear_number = 0;
        int i = a[j];
        while (i <= b[j]) {
            if ((((i % 4) == 0) && ((i % 100) != 0)) || ((i % 400) == 0)) {
                printf("%d\n", i);
                leapyear_number++;
            }
            i++;
        }
        if (leapyear_number == 0){
            printf("NA\n\n");
        } else {
            printf("\n");
        }
        j++;    
    }
}

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);
            printf("\n");
        }
    }
    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\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() {
  int a, b;
  cin >> a >> b;
  while(b) {
    bool flag = true;
    for (int i = a; i <= b; ++i) {
      if ((i % 400 == 0) ||
          (i % 4 ==0 && i % 100 != 0)) {
        cout << i << endl;
        flag = false;
      }
    }
    if (flag)
      cout << "NA" << endl;

    cin >> a >> b;
    if (b)
      cout << endl;
  }
}

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);
        counter = 0;
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            for(int i = start_year; i <= end_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(){
	int a,b;
	bool first=true;

	while(cin>>a>>b,a||b){
		bool flag=true;
		if(!first)
			cout<<endl;
		else
			first=false;

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

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

bool is_leap_year(int y);

int get_leap_years(int* leap_years_list, int year_begin, int year_end);

int main()
{
    int leap_years_list[1000]; //A.D. 0 - A.D. 3000 の間に閏年は高々1000個しかない

    bool first_set = true; //一つ目のセットの前にだけは改行を入れてはいけないので

    while (true) {
        int year_begin, year_end;

        //読み込み
        scanf("%d %d", &year_begin, &year_end);

        //終了判定
        if (year_begin == 0 && year_end == 0) {
            break;
        }

        //閏年を計算する
        int leap_years_count = get_leap_years(leap_years_list, year_begin, year_end);

        //セットとセットの間には空行を入れる
        if (first_set) {
            first_set = false;
        } else {
            putchar('\n'); //putcharは一文字だけ出力する関数です
        }

        //閏年を出力
        if (leap_years_count == 0) {
            puts("NA"); //putsは与えられた文字列を出力した後改行する関数です
        } else {
            for (int i = 0; i < leap_years_count; i++) {
                printf("%d\n", leap_years_list[i]);
            }
        }
        
    }
}

bool is_leap_year(int y)
{
    if (y % 400 == 0) {
        return true; 
    } else if (y % 100 == 0) {
        return false;
    } else {
        return y % 4 == 0; 
    }
}

int get_leap_years(int* leap_years_list, int year_begin, int year_end)
{
    int leap_years_count = 0;
    for (int year = year_begin; year <= year_end; ++year) {
        if (is_leap_year(year) == true) {
            *(leap_years_list + leap_years_count) = year;
            ++leap_years_count;
        }
    }
    return leap_years_count;
}