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>

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

C++: #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 = 1;
            }
        }
        if (exist == 0) {
            printf("NA\n");
        }
    }
    return 0;
}

C++: #include <stdio.h>

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

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

int main(){

  int a, b, valid, cnt;

  cnt = 0;
  while(cin >> a >> b){
    if(a == 0 && b == 0) break;
    valid = 0;
    if(cnt != 0) cout << endl;
    
    for(int i=a; i<=b; i++){
      if(i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)){
        cout << i << endl;
        valid = 1;
      }
    }

    if(valid == 0) cout << "NA" << endl;
    cnt++;

  }

  return 0;

}

C++: #include<iostream>

using namespace std;

int main(void){
	bool bFirst = true;
	while( true ){
		int a, b;
		bool bFound = false;

		cin >> a >> b;
		if( a==0 && b==0 ) break;
		
		if( bFirst ){
			bFirst = false;
		}else cout << endl;

		for(int i = a; i <= b; i++){
			if( i % 4 == 0 && (i % 100 != 0 || i % 400 == 0)){
				bFound = true;
				cout << i << '\n';
			}
		}
		if( !bFound ) cout << "NA\n";
	}
	return 0;
}

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

bool is_uruu(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;
		int count = 0;
		for(int i = a; i <= b; i++){
			if(is_uruu(i)){
				cout << i << endl;
				count++;
			}
		}
		if(count == 0){
			cout << "NA" << endl << endl;
		}else{
			cout << endl;
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    while(1){
        int a,b,count=0;
        cin>>a>>b;if(a==0&&b==0)return 0;
        for(;a<=b;++a){
            if(a%4==0){
                if(a%100==0){
                    if(a%400==0){
                        cout<<a<<endl;++count;continue;
                        }
                        continue;
                }
                cout<<a<<endl;++count;
            }
        }
        if(count==0)cout<<"NA"<<endl;
    }
}

C++: #include <stdio.h>

void leap_year(int start, int end)
{
    int y = 0;
    for (int x = start; x <= end; ++x) {
        if (x % 4 == 0 && (x % 100 != 0 || x % 400 == 0)) {
            printf("%d\n", x);
            ++y;
        }
    }
    if (y == 0) {
        printf("NA\n");
    }
}
        
int main(void)
{
    while (1) {
        int start, end;
        scanf("%d %d", &start, &end);
        if (start == 0 && end == 0) {
            break;
        } else {
            leap_year(start, end);
        }
    }
    printf("\n");
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int a,b;

	while(1){

		int count = 0;

		cin >> a >> b;
		cout << endl;
		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 <iostream>
using namespace std;

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

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

int main(){
	int A,B;
	int tc=0;
	while(cin>>A>>B,A||B){
		if(tc!=0) puts("");
		bool flag=false;
		for(int i=A;i<=B;i++){
			if(i%4==0 && (i%100!=0 || i%400==0)){
				printf("%d\n",i);
				flag=true;
			}
		}
		if(flag==false) puts("NA");
		tc++;
	}
	return 0;
}

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

int main(void)
{
  int a, b;
  int flag;
  
  while(1)
    {
      cin >> a >> b;
      if(a == 0 && b == 0) break;
      flag = 0;

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

C++: #include <iostream>

using namespace std;

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

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

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