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

int main(void){
	int a,b;
	while(cin >> a >> b){
		if(a==0&&b==0)break;
		bool na = false;
		for(int i=a;i<=b;i++){
			if(isleapyear(i)){
				cout << i << "\n";
				na = true;
			}
		}
		if(!na)cout << "NA\n";
		cout << "\n";
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
#include <algorithm>
#include <stdio.h>
int main(void)
{
	int a[100], b[100], i = 0, j, k;
	bool flag = false;
	
	while (1){
		scanf_s("%d %d", &a[i], &b[i]);
		if (a[i] == 0 && b[i] == 0) break;
		if (a[i] % 400 < 400 - 4){ a[i] += 4 - (a[i] % 4); }
		i++;
	}
	for (j = 0; j <= i; j++){
		if (j != 0) { printf("\n"); }
		for (k = a[j]; k < b[j];k+=4){
			if (k % 100 == 0){
				if (k % 400 == 0) {
					printf("%d\n", k); 
					flag = true; 
				}
			}
			else {
				printf("%d\n", k);
				if (k % 400 > 400 - 4){
					printf( "%d\n", k + (400 - (k % 400)) ); 
				}
				flag = true;
			}
		}
		if (flag == false) { printf("NA\n"); }
		flag = false;
	}
}

C++: #include <stdio.h>

int main(void)
{
	int i,a,b;
	bool year [3001]={0};
	
	for(i=1; i<3000; i++){
		if(i % 4 == 0){
			year[i] = 1;
		}
	}
	
	for(i=100; i<3000; i+=100){
		year[i] = 0;
	}
	for(i=400; i<3000; i+=400){
		year[i] = 1;
	}
	while(1){
		bool flag=0;
		scanf("%d %d", &a, &b);
		if(a==0)break;
		for(i=a;i<=b;i++){
			if(year[i] == 1){
				printf("%d\n",i);
				flag=1;
			}
		}
		if(flag==0)printf("NA\n");
		puts("");
	}
	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++){
                counter += leap_year(i); 
                }
            if( counter == 0){
                printf("NA\n");
            }
        }
    }
    return 0;
}
    
    
int leap_year(int x)
{
    if((x % 4 == 0 && !(x % 100 == 0)) || x % 400 == 0){
        printf("%d\n", x);
        printf("\n");
        return 1;
    }
    return 0;
}

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

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

		if(flag) printf("NA\n");

		first=true;
	}
	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);
            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(){
	while(1){
		int a, b, x[3000];
		int l=0;
		
		cin >> a >> b;
		
		if(a==0 && b==0) break;
		
		for(int i=a; i<=b; i++){
			if(0==i%4 && 0!=i%100 ){
				x[l]=i;
				l++;
			}else if(0==i%400){
				x[l]=i;
				l++;
			}
		}
		
		if(l==0) cout << "NA" <<endl;
		
		for(int m=0; m<l && l!=0; m++){
			cout << x[m] <<endl;
		}
		
		cout <<endl;
		
	}
}

C++: #include <stdio.h>

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

int main(void)
{
    int year, from, until, num_leap_year, flag = 0;
    while (1) {
        num_leap_year = 0;
        scanf("%d %d", &from, &until);
        if (from == 0 && until == 0) {
            break;
        } else {
            if (flag != 0) {
                printf("\n");
            }
        }
        for (year = from; year <= until; year++) {
            if (isLeapYear(year) == true) {
                num_leap_year++;
                printf("%d\n", year);
            }
        }
        if (num_leap_year == 0) {
            printf("NA\n");
        }
        flag = 1;
        //printf("\n");
    }
    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);
        counter = 0;
        if(start_year == 0 && end_year == 0){
            break;
        }else{
            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;
    }
    return 0;
}

C++: File Edit Options Buffers Tools C Help
#include <stdio.h>
int main(void)
{
    int start, finish;
    int exist;
    while(1){
        exist = 0;
        scanf("%d %d", &start, &finish);
        if (start == 0 && finish == 0) {
            break;
        }
        for(; start <= finish; start++) {
            if((start % 4 == 0 && start % 100 != 0) || start % 400 == 0) {
            printf("%d\n", start);
            ++exist;
            }
        }
        if (exist == 0) {
            printf("NA\n");
        }
    }
    return 0;
}

C++: #include <iostream>


int leap_year(int y) {
	if( y % 400 == 0) {
		return 1;/*???????????´*/
	} else if (y % 100 == 0 && y % 400 != 0) {
		return 0;/*???????????´??§??????*/
	} else if (y % 4 == 0 && y % 100 != 0) {
		return 1;
	} else {
		return 0;
	}
}
int main()
{
	int a;
	int b;
	while (true) {
		std::cin >> a >> b;
		if (a == 0 && b == 0) {
			break;
		} else {
			int sum = 0;
			for (int k = a; k <= b; k++) {
				sum = sum + leap_year(k);
			}
			if (sum == 0 /*????????????????????´?????????*/) {
				std::cout << "NA" << std::endl;
			} else {
			    for (int i =a; i <= b; i++) {
					if (leap_year(i) == 1) {
						std::cout << i << std::endl;
					}
				}
			}
			std::cout << std::endl;
		}
	}
	return 0;
}