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;

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

C++: #include <iostream>

using namespace std; 

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

C++: #include <iostream>
using namespace std;
int main()
{
    while(1){
        int a,b,count=0;
        do{cin>>a>>b;}while(a>=3000&&b>=3000);
        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;
        cout<<endl;
    }
}

C++: #include <iostream>

using namespace std;

int main(){
	int a,b;
	while(cin >> a >> b){
		int count=0;
		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 << "\n";
				count++;
			} 
		}
		if(count==0){
			cout << "\n";
			cout << "NA\n";
		}
	}

	return 0;
}

C++: #include <iostream>

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

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>

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

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

C++: #include<stdio.h>
int main(void)
{
	int i,a,b,w,x,flg,cnt;
	cnt=0;
	scanf("%d %d",&a,&b);
	while(a!=0 && b!=0){
		flg=0;
		if(cnt!=0){
			printf("\n");
		}
		for(i=a;i<=b;i++){
			if(i%4==0 && i%100!=0){
			//	if(i%100!=0){
					printf("%d\n",i);
					flg=1;
				//}
			}
			else if(i%400==0){
				printf("%d\n",i);
				flg=1;
			}
			cnt++;
		}
		if(flg==0){
			printf("NA\n");
		}
		scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int i,a,b,w,x,flg,cnt;
	cnt=0;
	scanf("%d %d",&a,&b);
	while(!(a==0 && b==0)){
		flg=0;
		if(cnt!=0){
			printf("\n");
		}
		for(i=a;i<=b;i++){
			if(a%4==0){
				if(a%100!=0){
					printf("%d\n",a);
					flg=1;
				}
			}
			else if(a%400==0){
				printf("%d\n",a);
				flg=1;
			}
			cnt++;
			a++;
		}
		if(flg==0){
			printf("NA\n");
		}
		scanf("%d %d",&a,&b);
	}
	return 0;
}

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

bool isLeapYear(int y) {
  if(!(y % 4)) {
    if(!(y % 100)) {
      if(!(y % 400)) return true;
      return false;
    }
    return true;
  }
  else return false;
}

int main() {
  int a, b;
  bool flag;
  while(cin >> a >> b && a && b) {
    flag = 0;
    for(int i = a; i <= b; ++i) {
      if(isLeapYear(i)) {
        flag = 1;
        cout << i << endl;
      }

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

    cout << endl;
  }
  return 0;
}

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

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

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> Point;

int main()
{
	int a, b;
	for(int i=0; scanf("%d%d", &a, &b), a||b; ++i){
		bool output = false;
		if(i)
			puts("");

		reep(j, a, b+1){
			if(j%4==0 && (j%100!=0 || j%400==0)){
				printf("%d\n", j);
				output = true;
			}
		}

		if(!output)
			puts("NA");
	}

	return 0;
}

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);
        }
    }
    return 0;
}

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;
bool first = true;
	for (; cin >> a >> b;) {
		if (a == b && !a) break;
if (first) first = false;
else cout << endl;
		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;
	}
}
int main() {
	q93();
	return 0;
}