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>
#include <array>

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

    long long int n;

    std::array<int, 150> age2generation;

    for (int i = 0; i < 70; ++i) {
        age2generation[i] = i / 10;
    }
    for (int i = 70; i < 150; ++i) {
        age2generation[i] = 6;
    }

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

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

    return 0;
}

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>
#include <sstream>
#include <complex>

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 fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n,y;

int main(){
	while (cin >> n&&n){
		int co[10] = {};
		REP(i, n){
			cin >> y;
			if (y >= 70)y = 60 + y % 10;
			co[y / 10]++;
		}
		REP(i, 7){
			cout << co[i] << endl;
		}
	}
}

C++: #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int,string> P;

static const double eps = 1e-8;

int main(){
	int n;

	while(~scanf("%d",&n)){
		if(n==0) break;
		int table[7];
		memset(table,0,sizeof(table));
		for(int i=0;i<n;i++){
			int age;
			scanf("%d",&age);
			table[age/10 >= 6 ? 6 : age/10]++; 
		}

		for(int i=0;i<7;i++){
			printf("%d\n",table[i]);
		}
	}
}

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

int classify(int age){
    if(age < 10)    return 0;
    if(age < 20)    return 1;
    if(age < 30)    return 2;
    if(age < 40)    return 3;
    if(age < 50)    return 4;
    if(age < 60)    return 5;
    return 6;
}

int main(){
    while(1){
        int n;
        cin >> n;

        if(n == 0)  break;

        int A[7] = {};

        while(n-- > 0){
            int age;
            cin >> age;
            A[classify(age)]++;
        }

        for(int x : A)  cout << x << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

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

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

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

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

C++: //Name: Tsuruga Castle
//Level: 1
//Category: 実装
//Note:

/**
 * 年齢 / 10 でビンに分ける。
 * 60歳以上を特別扱いすることに注意。
 */
#include <iostream>
#include <array>
#include <algorithm>

using namespace std;

bool solve() {
    int N;
    cin >> N;
    if(!N) return false;

    array<int,7> bins;
    fill(begin(bins), end(bins), 0);

    for(int i = 0; i < N; ++i) {
        int age;
        cin >> age;
        age /= 10;
        if(age > 6) age = 6;
        bins[age]++;
    }
    for(int i = 0; i < 7; ++i) {
        cout << bins[i] << endl;
    }
    return true;
}

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

    while(solve()) ;
    return 0;
}

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


class Solver
{
private:
	int n;
	int customer[130] = {};
	bool Input()
	{
		cin >> n;
		if (n == 0)return false;
		for (int i = 0; i < n; i++)
		{
			int a;
			cin >> a;
			customer[a]++;
		}
		return true;
	}
	//[min,max]
	int NumOfCustomers(int min, int max)
	{
		int num = 0;
		for (int i = min; i <= max; i++)
		{
			num += customer[i];
		}
		return num;
	}

	void Output()
	{
		for (int i = 0; i <= 5; i++)
		{
			cout << NumOfCustomers(10 * i, 10 * i + 9) << endl;
		}
		cout << NumOfCustomers(60,120) << endl;
	}

public:
	bool Solve()
	{
		if (Input())
		{
			Output();
			return true;
		}
		else return false;
	}
};

int main()
{
	while(Solver().Solve());
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		const int B[]={0,10,20,30,40,50,60};
		int count[7]={0};
		for(int i=0,age;i<n;++i){
			cin>>age;
			for(int j=6;j>-1;--j) if(B[j]<=age){++count[j];break;}
		}
		for(int i=0;i<7;++i)cout<<count[i]<<"\n";
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int n;
	int date[8] = {0,9,19,29,39,49,59,1000};
	while(cin>>n){
		int freq[7]={0};
		if(!n) break;
		while(n--){
			int year;
			cin >> year;
			for(int i=0;i<7;i++){
				if(date[i]<=year&&year<date[i+1]){
					freq[i]++;
					break;
				}
			}
		}
		for(int i = 0; i < 7; i++){
			cout << freq[i] << endl;
		}
	}
	return 0;
}

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

        while (n--) {
            std::cin >> age;
            age < 70 ? ++arr[age / 10] : ++arr[6];
        }

        for (const auto& cnt : arr) {
            std::cout << cnt << '\n';
        }
    }

    return 0;
}

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

int main(){
	int n,in;
	int i;
	while(cin>>n && n!='0'){
		int k[7]={0};
		for(i=0;i<n;i++){
			cin>>in;
			if(in>60) in=60;
			(k[in/10])++;
			}
		for(i=0;i<7;i++){
			cout<<k[i]<<endl;
		}
	}
	return 0;
}

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

int getIndex(int x) {
  if(x < 10) return 0;
  if(x < 20) return 1;
  if(x < 30) return 2;
  if(x < 40) return 3;
  if(x < 50) return 4;
  if(x < 60) return 5;
  return 6;
}

int main() {
  for(int n; cin >> n && n;) {
    vector<int> v(7);
    for(int i = 0; i < n; ++i) {
      int x;
      cin >> x;
      ++v[getIndex(x)];
    }
    for(int i = 0; i < 7; ++i) {
      cout << v[i] << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,o,a[7];
	while(true){
		cin >> n;
		if(!n)
			return 0;
		for(int i=0; i<7; i++)
			a[i] = 0;
		for(int i=0; i<n; i++){
			cin >> o;
			o /= 10;
			a[o]++;
		}
		for(int i=0; i<7; i++)
			cout << a[i] << endl;
	}
}