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

int main(){
	
int x,y,c=0;
bool f[1000001];

for(int i=0;i<1000001;i++)
{f[i]=false;}

for(int i=1;i<=1000001;i++)
{
if(i%2==0)f[i]=true;
else if(i%3==0)f[i]=true;
else if(i%5==0)f[i]=true;
}

while
	(1)
	//(scanf("%d",&x)!=0)
{
	scanf("%d",&x);
	if(x==0)break;
//cin>>y;
	scanf("%d",&y);
	
	
	for(int i=x;i<=y;i++)
{if(f[i]==true)c++;
	}
	
	
	/*
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<stdio.h>



int main(){

long big=60*60*60*60*60*60;
int x,y;

while(1)
{
int c=0;
scanf("%d",&x);if(x==0)break;

scanf("%d",&y);

for(int i=x;i<=y;i++)
if(big%i==0)c++;

printf("%d\n",c);

}
return 0;
}

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

int main(){
  int a,b;
  while(cin >> a,a ){
    cin >> b;
    int cnt = 0;
    for(int i = a ; i <= b ; 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)cnt++;
    }
    cout << cnt << endl;
  }
}

C++: #include<iostream>
using namespace std;
bool f(int a)
{
	while(a%3<1)a/=3;
	while(a%5<1)a/=5;
	return __builtin_popcount(a)==1;
}
main()
{
	int m,n;
	while(cin>>m,m)
	{
		cin>>n;int cnt=0;
		for(;m<=n;m++)cnt+=f(m);
		cout<<cnt<<endl;
	}
}

C++: #include<iostream>
#define D 1000000
using namespace std;
bool flg[D];
int ans[D];
int main(){
	
	int m,n;
	flg[1] = true;
	for(int i = 0;i <= D;i++){
		if(flg[i]){
			if(2*i<=D)flg[2*i] = true;
			if(3*i<=D)flg[3*i] = true;
			if(5*i<=D)flg[5*i] = true;
			//cout<<i<<endl;
		}
	}
	int cnt = 0;
	for(int i = 0;i <= D;i++){
		if(flg[i]) cnt++;
		ans[i] = cnt;
		//cout<<ans[i]<<endl;
	}
	while(cin>>m,m){
		cin>>n;
		cout<<ans[n] - ans[m-1]<<endl;
	}
	


}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll; 
typedef pair<ll, ll> PL;

ll n, m;

int main(){
	while (cin >> m >> n){
		ll c = 0, x = pow(60.0, 4.0);
		FOR(i, m, n + 1){
			if (x % i == 0){
				c++;
			}
		}
		cout << c << endl;
	}
}

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

int main(){
  int a,b;
  int x,y;
  cin>>a>>b;
  for(int i=a;i<=b;i++){
    x=i;
    while(x%2==0) x/=2;
    while(x%3==0) x/=3;
    while(x%5==0) x/=5;
    if(x==0)y++;
  }cout<<y;
  return 0;
}

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

int x[2000000];
long long p;
int a, b, sum;

int main() {
	for (int i = 0; i < 20; i++) {
		for (int j = 0; j < 13; j++) {
			for (int k = 0; k < 9; k++) {
				p = (int)pow(2, i)*(int)pow(3, j)*(int)pow(5, k);
				if (p < 2000000) {
					x[p] = 1;
				}
			}
		}
	}
	while (true) {
		sum = 0;
		cin >> a;
		if (a == 0) { break; }
		cin >> b;
		for (int i = a; i <= b; i++){
			sum += x[i];
		}
		cout << sum << endl;
	}
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	set<int> s;
	queue<int> q;
	q.push(1);
	while(q.size()){
		int n=q.front();
		q.pop();
		if(!s.insert(n).second)
			continue;
		if(n*2<=1000000) q.push(n*2);
		if(n*3<=1000000) q.push(n*3);
		if(n*5<=1000000) q.push(n*5);
	}
	vi res(allof(s));
	
	for(int m,n;cin>>m,m;){
		cin>>n;
		cout<<upper_bound(allof(res),n)-lower_bound(allof(res),m)<<endl;
	}
	
	return 0;
}

C++: //ハミング数

#include<iostream>
using namespace std;

int main()
{

  while(1){
  

    int m,n,cnt=0;
    
  
      cin >> m;
      if(m==0)
        break;
      cin >> n;
 
      
    for(int i=n; m<=i; i--){
      if(i==1){
        cnt++;

        break;
      }
      int a=i;
      if(a%2==0 || a%3==0 || a%5==0){
         while(1){
           if(a%2!=0 || a==1)
             break;
           a=a/2;
         }
         while(1){
           if(a%3!=0 || a==1)
             break;
           a=a/3;
         }
         while(1){
           if(a%5!=0 || a==1)
             break;
           a=a/5;
         }
     }    
      
     if(a==1)
       cnt++;
       
      }
    cout << cnt << 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;
}