Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == 0 {
			break
		}
		ans := make([]int, 7)
		for i := 0; i < n; i++ {
			scanner.Scan()
			a, _ := strconv.Atoi(scanner.Text())
			switch {
			case a < 10:
				ans[0]++
			case 10 <= a && a < 20:
				ans[1]++
			case 20 <= a && a < 30:
				ans[2]++
			case 30 <= a && a < 40:
				ans[3]++
			case 40 <= a && a < 50:
				ans[4]++
			case 50 <= a && a < 60:
				ans[5]++
			case 60 <= a:
				ans[6]++
			}
		}
		for i := range ans {
			fmt.Println(ans[i])
		}
	}
}

C++: #include <iostream>

using namespace std;
 
int judge(int);
 
int main(){
    int n,age;
 
    for(;;){
	int cnt[7]={0};
 
	cin >> n;
	if( n == 0 ) break;
 
	for( int i = 0 ; i < n ; i++ ){
	    cin >> age;
	    cnt[judge(age)]++;
	}
	for( int i = 0 ; i < 7 ; i++ ) cout << cnt[i] << endl;
    }
    return 0;
}
 
int judge(int age){
    return age/10;
}

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

int main()
{
	const int range[] = { 0, 10, 20, 30, 40, 50, 60, 1000 };

//	cut here before submit 
//	freopen ("testcase.tsuruga", "r", stdin );

	while (1){
		int n;
		cin >> n;
		if (n == 0){
			break;
		} // end if

		vector <int> hist (7, 0 );
		int i,j;
		for (i = 0; i < n; ++i){
			int age;
			cin >> age;
			for (j = 0; j < 7; ++j){
				if (age >= range[j] && age < range[j+1] ){
					++hist[j];
					break;
				} // end if
			} // end for
		} // end for
		for (j = 0; j < 7; ++j){
			cout << hist[j] << endl;
		} // end for
	} // end loop
		
	return 0;
}

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++)

int n;
const int ar[7] = { 9, 19, 29, 39, 49, 59, 1<<30 };

void solve() {
  int ans[7], temp;
  rep (i,7) ans[i] = 0;
  rep (i,n) {
    cin >> temp;
    int v = lower_bound(ar, ar + 7, temp) - ar;
    ans[v]++;
  }
  rep (i,7) cout << ans[i] << endl;
}

int main() {
  while (cin >> n, n) {
    solve();
  }
  return 0;
}

C++: #include<iostream>
int main() {
  int am[7]={0,0,0,0,0,0,0};
  int i,k;
  while(1) {
    std::cin>>i;
    if(i==0)break;
    for(int j=0;j<i;j++) {
      std::cin>>k;
      if(k>60)k=60;
      am[k/10]++;
    }
    for(i=0;i<7;i++) std::cout<<am[i]<<"\n",am[i]=0;
  }
}

C++: #include <iostream>

using namespace std;

int main(){
  int n;
  int nenrei;

  while(cin >> n,n ){
  int ans0=0,ans10 = 0,ans20 = 0,ans30 = 0,ans40 = 0,ans50 = 0;
  int ansover = 0;

    for(int i = 0;i < n;i++){    

      cin >> nenrei;
      if(nenrei<10)ans0++;
      else if(nenrei<20)ans10++;
      else if(nenrei<30)ans20++;
      else if(nenrei<40)ans30++;
      else if(nenrei<50)ans40++;
      else if(nenrei<60)ans50++;
      else ansover++;
         }
    cout <<"ans"<< ans0 << endl;
    cout << "ans"<<ans10 << endl;
    cout << "ans"<<ans20 << endl;
    cout <<"ans"<< ans30 << endl;
    cout << "ans"<<ans40 << endl;
    cout << "ans"<<ans50 << endl;
    cout << "ans"<<ansover << endl;

  }
  return 0;
}

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

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }
        int ages[7] = {};
        for (int i = 0; i < n; i++) {
            int input;
            cin >> input;
            if (input < 10) {
                ages[0]++;
            } else if (input < 20) {
                ages[1]++;
            } else if (input < 30) {
                ages[2]++;
            } else if (input < 40) {
                ages[3]++;
            } else if (input < 50) {
                ages[4]++;
            } else if (input < 60) {
                ages[5]++;
            } else {
                ages[6]++;
            }
        }
        for (int i = 0; i < 7; i++) {
            cout << ages[i] << endl;
        }
    }
}

C++: #include<iostream>

using namespace std;

int main() {
	
	int n;
	
	while(cin >> n) {
	
	int A[7] = {0};
	
	if( n == 0)
	break;
	
	for(int i=0;i<n;i++) {
		
		int age;
		
		cin >> age;
		
		if( age >= 60)
		A[6]++;
		
		else
		A[age/10]++;
	}
	for(int i=0;i<7;i++)
	cout << A[i] << "\n";
	
}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    int n,x[100],i,a=0,b=0,c=0,d=0,e=0,f=0,g=0;
    for(;;){
        cin>>n;
        if(n==0){
            break;
        }
        for(i=0;i<n;i++){
            cin>>x[i];
            if(x[i]<10){
                a++;
            }
            else if(x[i]>=10&&x[i]<20){
                b++;
            }
            else if(x[i]>=20&&x[i]<30){
                c++;
            }
            else if(x[i]>=30&&x[i]<40){
                d++;
            }
            else if(x[i]>=40&&x[i]<50){
                e++;
            }
            else if(x[i]>=50&&x[i]<60){
                f++;
            }
            else{
                g++;
            }
        }
        cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e<<endl<<f<<endl<<g<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	long n,p;
	long age[7];
	while(cin >> n){
		if(n == 0) return 0;
		for(int i=0; i<7; i++) age[i]=0;
		for(int i=0; i<n; i++){
			cin >> p;
			if(p < 10)
				age[0]++;
			if(p > 10 && p < 20)
				age[1]++;
			if(p > 20 && p < 30)
				age[2]++;
			if(p > 30 && p < 40)
				age[3]++;
			if(p > 40 && p < 50)
				age[4]++;
			if(p > 50 && p < 60)
				age[5]++;
			if(p >= 60)
				age[6]++;
		}
	for(int i=0; i<7; i++)
		cout << age[i] << endl;
	}
}

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

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    long int n;

    while (std::cin >> n, n++) {
        long int age;
        std::array<long int, 7> arr{{}};

        for (; --n;) {
            std::cin >> age;
            age < 70 ? ++arr[age / 10] : ++arr[6];
        }
        
        for (const auto& cnt : arr) {
            std::cout << cnt << std::endl;
        }
    }

    return 0;
}

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

int main() {
    int n, age;
    while (cin >> n, n) {
        int num[7] = {};
        for (int i=0; i<n; ++i) {
            cin >> age;
            if (age < 10) {
                ++ num[0];
            } else if (age < 20) {
                ++ num[1];
            } else if (age < 30) {
                ++ num[2];
            } else if (age < 40) {
                ++ num[3];
            } else if (age < 50) {
                ++ num[4];
            } else if (age < 60) {
                ++ num[5];
            } else {
                ++ num[6];
            }
        }
        for (int i=0; i<7; ++i) {
            cout << num[i] << endl;
        }
    }
    return 0;
}

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

using namespace std;

int main()
{
	int n;
	int sec[] = { 10, 20, 30, 40, 50, 60, 99 };
	while (scanf("%d", &n), n)
	{
		int v[100];
		memset(v, 0, sizeof(v));
		while (n--)
		{
			int t;
			scanf("%d", &t);
			++v[t];
		}
		int s = 0;
		for (int i = 0, j = 0; i < 100; ++i)
		{
			if (i == sec[j])
			{
				printf("%d\n", s);
				s = 0;
				++j;
			}
			else
				s += v[i];
		}
	}

	return 0;
}