Go: package main

import (
	"bufio"
	"os"
		"strings"
	"strconv"
			"fmt"
	)

var scanner = bufio.NewScanner(os.Stdin)
const (
	MAX = 1000000
)
func main() {
	a := make([]int, MAX+1)
	a[1] = 1
	for i := 2; i <= MAX; i *= 2 {
		a[i]++
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*3; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*5; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		m, _ := strconv.Atoi(buf[0])
		if m == 0 {
			break
		}
		n, _ := strconv.Atoi(buf[1])
		cnt := 0
		for i := m; i <= n; i++ {
			if a[i] != 0 {
				cnt++
			}
		}
		fmt.Println(cnt)
	}
}

C++: #include <set>
#define M 1000001
using namespace std;

int a[M];
int main(){
  set<int> s;
  int t,u;
  s.insert(1);
  s.insert(2);
  s.insert(3);
  s.insert(5);
  set<int>::iterator ite=s.begin();
  while((t=*ite)<M){
    if(t*2>t)s.insert(t*2);
    if(t*3>t)s.insert(t*3);
    if(t*5>t)s.insert(t*5);
    ite++;
  }
  for(ite=s.begin();*ite<M;ite++)a[*ite]=1;
  for(t=0;t<M;t++)a[t]+=a[t-1];
  for(;scanf("%d",&t),t;printf("%d\n",a[u]-a[t-1]))
    scanf("%d",&u);
  return 0;
}

C++: #include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;

int main(){
	long long int A,B;
	int n[101][101][3]={};
	while(1){
		cin>>A>>B;
		if(A==0&&B==0)break;
		long long int g=60;int c=0;
		for(long long int i=A;i<=B;i++){g=60;
		for(long long int j=1;j<11;j++)
		{
			if(g%i==0){//cout<<g<<endl;
			c++;break;}
		else{g*=60;}
		}
		}
		cout<<c<<endl;
		
	}
	return 0;
}

C++: #include <vector>
#include <iostream>

using namespace std;

unsigned long long power(int a, int b)
{
	if (b == 0) { return 1LL; }

	return power(a, b - 1) * a;
}

int main()
{
	vector<bool> s(1000001, false);

	for (int i = 0; i < 22; i++)
	{
		for (int j = 0; j < 14; j++)
		{
			for (int k = 0; k < 10; k++)
			{
				unsigned long long sum = power(2, i) * power(3, j) * power(5, k);

				if (sum <= 1000000ULL)
				{
					s[sum] = true;
				}
			}
		}
	}

	int m, n;

	while (cin >> m >> n)
	{
		int sum = 0;

		for (int i = m; i <= n; i++)
		{
			sum += (s[i] ? 1 : 0);
		}

		cout << sum << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<set>
#include<string>
using namespace std;
int main() {
	set<long long>a;
	long long b, c,sum = 1;
	for (int i = 0; i <= 19; i++) {
		b = sum;
		for (int j = 0; j <= 12; j++) {
			c = sum;
			if (sum > 1000000)
				break;
			for (int z = 0; z <= 8; z++) {
				a.insert(sum);
				if (sum > 1000000)
					break;
				sum *= 5;
			}
			sum = c;
			sum *= 3;
		}
		sum = b;
		sum *= 2;
	}
	int m, n,o=0;
	string d, h = "";
	while (getline(cin, d)) {
		m = 0;
		n = 0;
		o = 0;
		if (d.length() == 1) break;
		d += " ";
		h = "";
		for (int i = 0; i < d.length(); i++) {
			if (d[i] == ' ') {
				if (o == 0) m = atoi(h.c_str());
				else n = atoi(h.c_str());
				o++;
				h = "";
			}
			else
				h += d[i];
		}
		set<long long>::iterator it = a.begin();
		int sum = 0;
		while ((*it) < m) {
			it++;
			if (it == a.end()) break;
		}
		while ((*it) >= m && (*it) <= n)
		{
			it++;
			sum++;
			if (it == a.end()) break;
		}
		cout << sum << endl;
	}
}

C++: #include <vector>
#include <iostream>

using namespace std;

long long power(int a, int b)
{
	if (b == 0) { return 1LL; }

	return power(a, b - 1) * a;
}

int main()
{
	vector<bool> s(1000001, false);

	for (int i = 0; i < 20; i++)
	{
		for (int j = 0; j < 12; j++)
		{
			for (int k = 0; k < 8; k++)
			{
				long long sum = power(2, i) * power(3, j) * power(5, k);

				if (sum <= 1000000LL)
				{
					s[sum] = true;
				}
			}
		}
	}

	int m, n;

	while (true)
	{
		cin >> m;

		if (m == 0) { break; }

		cin >> n;

		int sum = 0;

		for (int i = m; i <= n; i++)
		{
			sum += (s[i] ? 1 : 0);
		}

		cout << sum << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

bool prime[10000];

void erat()
{

    for (int i = 2; i < 10000; i++) {
        prime[i] = true;
    }

    for (int i = 2; i < 5000; i++) {
        if (prime[i]) {
            for (int j = 2; j*i < 10000; j++) {
                prime[i*j] = false;
            }
        }
    }
}

int main() 
{
    int m, n;
    cin >> m;

    erat();

    while (m) {
        cin >> n;
        int count = 0;

        for (int i = m; i < n+1; i++) {
            bool fl = true;
            for (int j = 7; j < 10000; j++) {
                if (prime[j] && !(i % j)) {
                    fl = false;
                    break;
                }
            }
            if (fl) {
                count++;
            }
        }
        cout << count << endl;
        cin >> m;
    }
    return 0;
}

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

int main(){
	int m, n, cou, sixty;
	while(1){
		cin >>m;
		if(m == 0) break;
		cin >>n;
		cou = 0;
		for(int i = m; i <= n; i++){
			sixty = 1;
			for(int j = 0; j < 5; j++){
				sixty *= 60;
				if(sixty % i == 0){
					cou++;
					break;
				}
			}
		}
		cout <<cou <<endl;
	}
	
	return 0;
}

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

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int a[1000010]={0};
bool flag[1000010]={false};
void hamming(){
	a[1]=1;
	flag[1]=true;
	for(int i=2;i <=1000000;i++){
		if(i%2==0&&flag[i/2])flag[i]=true;
		if(i%3==0&&flag[i/3])flag[i]=true;
		if(i%5==0&&flag[i/5])flag[i]=true;
		if(flag[i]){
			a[i]=(a[i-1]+1);
		}else{
			a[i]=a[i-1];
		}
	}
	return ;
}
int main(){
	hamming();
	int n,m;
	while(cin>>n>>m,n){
		cout <<a[m]-a[n-1]<<endl;
	}
	return 0;
}

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

int main(){
	int n,m,ret;
	while(cin >> n && n){
		cin >> m;
		ret = 0;
		for(int i=n;i<=m;i++){
			int c = i;
			while(c%2==0){
				c/=2;
			}
			while(c%3==0){
				c/=3;
			}
			while(c%5==0){
				c/=5;
			}
			if(c==1)ret++;
		}
		cout << ret << endl;
	}
}

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

const int MX = 1000001;
bool hamming[MX];
int ac[MX];

int main() {
    memset(hamming, 0, sizeof hamming);
    hamming[1] = true;
    ac[0] = 0;
    for (int i=1; i<MX; ++i) {
        if (hamming[i]) {
            if (i*2<MX) hamming[i*2] = true;
            if (i*3<MX) hamming[i*3] = true;
            if (i*5<MX) hamming[i*5] = true;
        }
        ac[i] = ac[i-1] + hamming[i];
    }
    int m, n;
    while (cin >> m, m) {
        cin >> n;
        cout << ac[n] - ac[m-1] << endl;
    }
    return 0;
}

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

int ans;

void dfs(int i){
if(i==1){ans++; return;}
if(i%2==0)dfs(i/2);
else if(i%3==0)dfs(i/3);
else if(i%5==0)dfs(i/5);
return;
}

int main(){
int m, n;
while(cin>>m, m){
cin>>n;
ans=0;

for(int i=m; i<=n; i++)dfs(i);
cout<<ans<<"\n";
}
return 0;
}

C++: #include<stdio.h>

int main(){

int x,y,c=0;

while(scanf("%d %d",&x,&y)
{
for(int i=x;i<=y;y++)
{
if(i%2==0)c++;
else if(i%3==0)c++;
else if(i%5==0)c++;
}
printf("%d\n",c);c=0;
}
return 0;
}