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 <iostream>
#include <algorithm>
using namespace std;

int hamming[1000000+1];
bool is_hamming[1000000+1];

int make_ham(int n)
{
	for(int i=0;i<n;i++){
		is_hamming[i] = false;
	}
	is_hamming[1] = true;
	for(int i=1;i<n;i*=2){
		is_hamming[i] = true;
		for(int j=i;j<n;j*=3){
			is_hamming[j] = true;
			for(int k=j;k<n;k*=5){
				is_hamming[k] = true;
			}
		}
		for(int j=i;j<n;j*=5){
			is_hamming[j] = true;
		}
	}
	int h = 0;
	for(int i=0;i<n;i++){
		if(is_hamming[i])
			hamming[h++] = i;
	}
	return h;
}

int main()
{
	int m,n;
	while(cin >> m){
		if(m == 0)
			break;
		cin >> n;
		int count = 0;
		int h = make_ham(n+1);
		for(int i=0;i<h;i++){
			if(hamming[i] >= m)
				count++;
		}
		cout << count << endl;
	}
	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
#include <utility>
#include <numeric>
#define  rep(i,n) for(int i=0;i<(n);i++)
#define  REP(i,a,n) for(int i=a;i<(n);i++)
#define  rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define  VI	vector<int>
#define	 VS vector<string>
#define  all(a) (a).begin(),(a).end()
#define  debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef pair<int,int> P;
typedef long long ll;

const int INF=1000000;
char fi[101][101];
int d[21][21];
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int N,M;
int sx,sy;
int gx,gy;
int w,h;
int ans;

int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int MAX_V=100;
const int MAX_N=100;
char o[3]={'+','-','*'};
#define md 1000003

int dp[353][353]={0};
int bow[353][353]={0};


int main(){
	
	int m,n;
	while(cin>>m,m!=0){
		ll count=0;
		cin>>n;
		for(int i=m;i<=n;i++){
			if(ll(pow(60,10))%i==0){
				count++;
			}
		}
		cout<<count<<endl;
	}
	
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(long i=(a);i<(b);i++)
#define RFOR(i,a,b) for(long i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(long i=0;i<(n);i++)
#define RREP(i,n) for(long i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    vector<long> two;
    vector<long> three;
    vector<long> five;
    vector<long> num;
    two.PB(1);
    three.PB(1);
    five.PB(1);
    for(long i=1;two.back()<1e6;i++){
	two.PB(two.back() * 2);
    }
    for(long i=1;three.back()<1e6;i++){
	three.PB(three.back() * 3);
    }
    for(long i=1;five.back()<1e6;i++){
	five.PB(five.back() * 5);
    }
    for(long i=0;i<two.size();i++){
	for(long j=0;j<three.size();j++){
	    for(long k=0;k<five.size();k++){
		if(two[i] * three[j] * five[k] < 1e6)
		    num.PB(two[i] * three[j] * five[k]);
	    }
	}
    }
    sort(ALL(num));
    while(true){
	long n,m;
	cin >> m;
	if(m == 0) break;
	cin >> n;
	long ans  = upper_bound(ALL(num),n) -  lower_bound(ALL(num),m);
	cout << ans << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;

int main(){
   int h[1000001];
   int i,n,m;
   h[1]=1;
   for(i=2;i<=1000000;i*=2)h[i]=1;
   for(i=1;i<=1000000;i++){
       if(h[i]){
           for(int j=i*3;j<=1000000;j*=3){
               if(h[j]==0)h[j]=2;
           }
       }
   }
   for(i=1;i<=1000000;i++){
       if(h[i]){
           for(int j=i*5;j<=1000000;j*=5){
               if(h[j]==0)h[j]=3;
           }
       }
   }
   while(cin>>n>>m&&n){
       int count=0;
       for(i=n;i<=m;i++){
           if(h[i]) count++;
       }
       cout<<count<<endl;
   }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)

int main()
{
  int m, n;
  bool a[1000010];
  int b[1000010];

  for(int i = 0; i < 1000010; i++) a[i] = false;

  for(int i = 1; i < 1000010; i *= 5) {
    for(int j = 1; i * j < 1000010; j *= 3) {
      for(int k = 1; i * j * k < 1000010; k *= 2) {
        a[i * j * k] = true;
      }
    }
  }

  b[0] = 0;
  for(int i = 1; i < 1000010; i++) {
    b[i] = b[i - 1] + (a[i] ? 1 : 0);
  }
  while(cin >> m, m){
    cin >> n;
    cout << b[n] - b[m - 1] << endl;
  }
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<math.h>
#include<climits>

using namespace std;
typedef unsigned long long ll;

int x[1000002];

int main(){
    memset(x, 0, sizeof(x));
    x[1]=1;
    for(int i=2;i<1000002;i++){
        int t=i;
        if(t%2==0)t/=2;
        if(t%3==0)t/=3;
        if(t%5==0)t/=5;
        if(x[t]==1)x[i]=1;
    }
    for(int i=1;i<1000002;i++){
        x[i]+=x[i-1];
    }
    int m,n;
    while(cin>>m,m){
        cin>>n;
        cout<<x[n]-x[m-1]<<endl;
    }
    
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const int list[3] = { 2, 3, 5 };
const int MAX_N = 1000002;
char dp[MAX_N];
int m, n;

int main() {
  fill(dp, dp + MAX_N, 0);
  dp[1] = 1;
  rep (i,MAX_N) if (dp[i]) {
    rep (j,3) if (i * list[j] < MAX_N) {
      dp[i * list[j] ] = 1;
    }
  }
  while (cin >> m, m) {
    cin >> n;
    int ans = 0;
    for (int i = m; i <= n; ++i) if (dp[i]) ans++;
    cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
typedef long long L;
int main() {
	L m,n;
	L a = pow(60,9);
	while (cin >> m, m) {
		cin >> n;
		int ans = 0;
		for (L i = m; i <= n; i++) {
			if (a%i==0)ans++;
		}
		cout << ans << endl;
	}
	return 0;
}

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

#define M_N 1000000

int h_num[M_N + 10];

using namespace std;

int main()
{
	for (int i = 1; i <= M_N; i *= 2){
		for (int j = i; j <= M_N; j *= 3){
			for (int k = j; k <= M_N; k *= 5){
				h_num[k] = 1;
			}
		}
	}
	
	for (int i = 1; i <= M_N; i++){
		h_num[i] += h_num[i - 1];
	}
	
	int n, m;
	while (scanf("%d %d", &m, &n), m != 0){
		printf("%d\n", h_num[n] - h_num[m - 1]);
	}
	
	return (0);
}