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])
		}
	}
}

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0184

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        visitors = defaultdict(int)

        for _ in range(n):
            age = int(input())
            if age < 10:
                visitors['under10'] += 1
            elif age < 20:
                visitors['10s'] += 1
            elif age < 30:
                visitors['20s'] += 1
            elif age < 40:
                visitors['30s'] += 1
            elif age < 50:
                visitors['40s'] += 1
            elif age < 60:
                visitors['50s'] += 1
            else:
                visitors['60s+'] += 1

        print(visitors['under10'])
        print(visitors['10s'])
        print(visitors['20s'])
        print(visitors['30s'])
        print(visitors['40s'])
        print(visitors['50s'])
        print(visitors['60s+'])



def main2(args):
    while True:
        n = int(input())
        if n == 0:
            break
        age = [0] * (12+1)

        for _ in range(n):
            n = int(input())
            age[n//10] += 1

        print(age[0])
        print(age[1])
        print(age[2])
        print(age[3])
        print(age[4])
        print(age[5])
        print(sum(age[6:]))


if __name__ == '__main__':
    main2(sys.argv[1:])

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int n;
	while (cin >> n, n) {
		int cnt[7]{};
		rep(i, n) {
			int d; cin >> d;
			if (d >= 60)cnt[6]++;
			else cnt[d / 10]++;
		}
		rep(i, 7)cout << cnt[i] << endl;
	}
}

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

int main(){

	int n, old[7], x;
	
	while(cin >> n){
		if(n == 0) break;
		fill(old, old+7, 0);
		
		for(int i=0; i<n; i++){
			cin >> x;
			if(x >= 60) old[6]++;
			else old[(x - x % 10) / 10]++;
		}
		
		for(int i=0; i<7; i++){
			cout << old[i] << endl;
		}
		
	}

	return 0;

}

C++: #include <iostream>
using namespace std;
int main(void){
#define MAX 1001000
    int n; //来場者数
    int a[MAX]; //来場者の年齢

    while(true){
        cin >> n;
        if(n == 0) break;

        for(int i = 0; i < n; i++)
            cin >> a[i];
        
        int c0 = 0, c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0;
        //10代未満の人数、10代の人数、20代の人数、30代の人数、40代の人数、50代の人数、60歳以上の人数
        for(int i = 0; i < n; i++){
            if(a[i] < 10) 
                c0++;
            else if(10 <= a[i] && a[i] < 20)
                c1++;
            else if(20 <= a[i] && a[i] < 30)
                c2++;
            else if(30 <= a[i] && a[i] < 40)
                c3++;
            else if(40 <= a[i] && a[i] < 50)
                c4++;
            else if(50 <= a[i] && a[i] < 60)
                c5++;
            else
                c6++;
        }
        cout << c0 << endl;
        cout << c1 << endl;
        cout << c2 << endl;
        cout << c3 << endl;
        cout << c4 << endl;
        cout << c5 << endl;
        cout << c6 << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
    int n;
    while(cin>>n,n){
        int cnt[10]={0};
        int age;
        while(n--){
            cin>>age;
            age/=10;
            if(age>=6)age=6;
            cnt[age]++;
        }
        for(int i=0;i<7;i++){
            cout<<cnt[i]<<endl;
        }
    }
}

C++: #include<stdio.h>

int main(){
int n[8]={};
int N,x;

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

for(int i=0;i<N;i++)
{
scanf("%d",&x);
if(x<10)n[0]++;
else if(x<20)n[1]++;
else if(x<30)n[2]++;
else if(x<40)n[3]++;
else if(x<50)n[4]++;
else if(x<60)n[5]++;
else if(x>=60)n[6]++;
}
for(int i=0;i<7;i++)
printf("%d\n",n[i]);
}
return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  while(1){
    cin>>n;
    if(n==0)break;
    vi a(13,0);
    rep(i,n){
      int x;
      cin>>x;
      a[x/10]++;
    }
    rep(i,6)
      cout<<a[i]<<endl;
    cout<<a[6]+a[7]+a[8]+a[9]+a[10]+a[11]+a[12]<<endl;
  }
}

C++: #include<iostream>

using namespace std;

#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)

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

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int n,m[7],a;

int main(){
	while(cin>>n){
		if(!n)return 0;
		fill(m,m+7,0);
		while(n--){
			cin>>a;
			m[min(a/10,6)]++;
		}
		for(int i=0;i<7;i++)cout<<m[i]<<endl;
	}
}

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

C++: #include <stdio.h>
#include <stack>
#include <math.h>

using namespace std;

int main(){

	int n,table[7],tmp;

	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		for(int i=0; i < 7; i++)table[i] = 0;

		for(int i=0; i < n; i++){
			scanf("%d",&tmp);

			if(tmp < 10){
				table[0]++;
			}else if(tmp < 20){
				table[1]++;
			}else if(tmp < 30){
				table[2]++;
			}else if(tmp < 40){
				table[3]++;
			}else if(tmp < 50){
				table[4]++;
			}else if(tmp < 60){
				table[5]++;
			}else{
				table[6]++;
			}
		}

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

	}

    return 0;
}

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 min(age/10,6);
}