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<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;
}

#include<stdio.h>

int main(){

int x,y,c=0;

while(scanf("%d %d",&x,&y))
{
for(int i=x;i<=y;i++)
{
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;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	bool isHamming[1000010] = {};
	isHamming[1] = true;
	rep(i, 1, 1000010 / 2) {
		if (isHamming[i])isHamming[i * 2] = true;
	}
	rep(i, 1, 1000010 / 3) {
		if (isHamming[i])isHamming[i * 3] = true;
	}
	rep(i, 1, 1000010 / 5) {
		if (isHamming[i])isHamming[i * 5] = true;
	}
	for (int m, n; cin >> m >> n&&m;) {
		int cnt = 0;
		rep(i, m, n + 1)if (isHamming[i])cnt++;
		cout << cnt << endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	int s;
	while(cin >> s, s)
	{
		int t;
		cin >> t;
		deque<bool> flag(t + 1);
		int count1 = 0;
		if(s == 1)
		{
			++count1;
		}
		queue<int> hamming;
		hamming.push(1);
		while(!hamming.empty())
		{
			int n = hamming.front();
			hamming.pop();
			if(n * 2 <= t && !flag[n * 2])
			{
				flag[n * 2] = true;
				hamming.push(n * 2);
				++count1;
			}
			if(n * 3 <= t && !flag[n * 3])
			{
				flag[n * 3] = true;
				hamming.push(n * 3);
				++count1;
			}
			if(n * 5 <= t && !flag[n * 5])
			{
				flag[n * 5] = true;
				hamming.push(n * 5);
				++count1;
			}
		}

		deque<bool> flag2(s + 1);
		int count2 = 0;
		queue<int> hamming2;
		hamming2.push(1);
		while(!hamming2.empty())
		{
			int n = hamming2.front();
			hamming2.pop();
			if(n * 2 < s && !flag2[n * 2])
			{
				flag2[n * 2] = true;
				hamming2.push(n * 2);
				++count2;
			}
			if(n * 3 < s && !flag2[n * 3])
			{
				flag2[n * 3] = true;
				hamming2.push(n * 3);
				++count2;
			}
			if(n * 5 < s && !flag2[n * 5])
			{
				flag2[n * 5] = true;
				hamming2.push(n * 5);
				++count2;
			}
		}
		/*int count2 = 0;
		for(int i = 0; i < s; ++i)
		{
			if(flag[i])
			{
				++count2;
			}
		}*/
		cout << count1 - count2 << endl;		
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
using namespace std;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-10
#define PB push_back
#define fi first
#define se second
#define ll long long 
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
typedef pair<int,int> Pii;
typedef vector<int> vi;
int ans[1000001];
ll mod_pow(ll x, ll n ,ll mod){
	if(n == 0) return 1;
	ll res = mod_pow(x*x%mod,n/2,mod);
	if(n & 1) res = res * x % mod;
	return res;
}
void makeHammingNumbers(){
	rep(i,1000000){
		rep(j,5){
			if(mod_pow(60,j,i+1)==0){
				ans[i+1] = 1;
				break;
			}
		}
	}
	return ;
}
int main(){
	makeHammingNumbers();
	reps(i,1,1000000){
		ans[i+1] += ans[i];
	}
	int m;
	while(scanf("%d",&m),m){
		int n;
		scanf("%d",&n);
		printf("%d\n",ans[n]-ans[m-1]);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

bool is_hamming[6000000];

int main(){
	
	for(int i = 0; i < 6000000; i++){
		is_hamming[i] = false;
	}
	
	is_hamming[1] = true;
	
	for(int i = 1; i <= 1000000; i++){
		if(is_hamming[i]){
			is_hamming[i * 2] = true;
			is_hamming[i * 3] = true;
			is_hamming[i * 5] = true;
		}
	}
	
	
	int m, n;
	
	while(true){
		
		cin >> m;
		
		if(m == 0){
			break;
		}
		
		cin >> n;
		
		int ans = 0;
		
		for(int i = m; i <= n; i++){
			if(is_hamming[i]){
				ans++;
			}
		}
		
		cout << ans << endl;
		
	}
	return 0;
}

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

int isHammingNumber(int n){
	int p=n;
	while(p%2 == 0)p/=2;
	while(p%3 == 0)p/=3;
	while(p%5 == 0)p/=5;
	return p==1;
}

int main() {
	
	int m,n;
	int count;
	
	while(count=0,cin>>m>>n,m){
		for(int i=m;i<=n;++i)if(isHammingNumber(i))++count;
		cout << count << endl;
	}
	return 0;	
}

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

vector<int> hamming;

void ham() {
  int temp;
  for(int i=0;i<21;i++) {
    for(int j=0;j<21;j++) {
      for(int k=0;k<21;k++) {
        temp = pow(2.0,(double)i)*pow(3.0,(double)j)*pow(5.0,(double)k);
        if(temp <= 1000000 && temp >= 0) {
        hamming.push_back(temp);
        }
        else {
          break;
        }
      }
    }
  }
}

int main() {
  int m,n,from,to;
  vector<int>::iterator low,up;
  ham();
  sort(hamming.begin(),hamming.end());
  while(cin >> m >> n) {
    low=lower_bound(hamming.begin(), hamming.end(), m);
    up=upper_bound(hamming.begin(),hamming.end(),n);
    from = int(low-hamming.begin());
    to = int(up-hamming.begin());
    cout << to-from << endl;
  }
}

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

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;
	}

	return 0;
}

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

const int lim = 1000010;

int dp[lim];

int main(){
	for(int s = 1; s < lim; s *= 5){
		for(int t = s; t < lim; t *= 3){
			for(int u = t; u < lim; u *= 2){
				dp[u] = 1;
			}
		}
	}
	for(int i = 1; i < lim; ++i){
		dp[i] += dp[i - 1];
	}

	int x, y;
	while(scanf("%d%d", &x, &y) == 2){
		printf("%d\n", dp[y] - dp[x - 1]);
	}
}