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 main(){
  
  int n,old[7],in;


  while(1){
    
    for(int i=0 ; i < 7 ; i++)old[i]=0;
    
    cin >>n;
    
    if(n == 0)break;
    
    
    for(int i=0 ; i < n ; i++){
      cin >>in;
      
      if(in >= 0 && in <= 9){
	old[0]++;
      }else if(in >= 10 && in <=19){
	old[1]++;
      }else if(in >= 20 && in <=29){
	old[2]++;
      }else if(in >= 30 && in <=39){
      old[3]++;		   
      }else if(in >= 40 && in <=49){
	old[4]++;
      }else if(in >= 50 && in <=59){
	old[5]++;
      }else{
	old[6]++;
      }
      
    }
    
    for(int i=0 ; i < 7 ; i++){
      cout <<old[i]<<endl;
    }
    
  }
  
  return 0;
}

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

int main(void) {
  int n, tmp;
  while (1) {
    cin >> n;
    if (n == 0) break;

    int age[7] = {0};
    while (n--) {
      cin >> tmp;
      if (tmp >= 60) {
	age[6]++;
      } else {
	age[tmp/10]++;
      }
    }

    for (int i = 0; i < 7; i++) {
      cout << age[i] << endl;
    }
  }
  return 0;
}

C++: //29
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(int n;cin>>n,n;){
    int num[7]={};
    while(n--){
      int a;
      cin>>a;
      num[min(a/10,6)]++;
    }
    for(int i=0;i<7;i++){
      cout<<num[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++) {
        std::array<long int, 7> arr{{}};
        int age;

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

    return 0;
}

C++: #include<stdio.h>

int main(){
	int a;
	while(1){
		scanf("%d",&a);
		if(a==0)return 0;
		int s[7]={0};
		for(int i=0;i<a;i++){
			int b;
			scanf("%d",&b);
			if(b>=60)s[6]++;
			else s[b/10]++;
		}
		for(int i=0;i<7;i++)printf("%d\n",s[i]);
	}
}

C++: #include<stdio.h>

int main(void)
{
	int dataset = 0;
	int age;
	int i;
	int s;
	int pnum[7] = {0};
	int n;
	while(1){
	scanf("%d",&dataset);
	if(n == 0)break;
	for(i = 0;i < dataset;i++)
	{
		scanf("%d",&age);
		if(age >= 70)
		{
			age = 60;
		}
		s = (age / 10);
		pnum[s]++;
	}
	for(i = 0;i < 7;i++)
	{
		printf("%d\n",pnum[i]);
	}
}

	return 0;
}

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

int main()
{
	int n;

	while(true){
		int x,x0=0,x10=0,x20=0,x30=0,x40=0,x50=0,x60=0;
		cin >> n;

		if(n==0)
			break;

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

			if(0<=x && 10>x)
				x0++;
			else if(10<=x && 20>x)
				x10++;
			else if(20<=x && 30>x)
				x20++;
			else if(30<=x && 40>x)
				x30++;
			else if(40<=x && 50>x)
				x40++;
			else if(50<=x && 60>x)
				x50++;
			else if(60<=x)
				x60++;
		}

		cout << x0 << endl;
		cout << x10 << endl;
		cout << x20 << endl;
		cout << x30 << endl;
		cout << x40 << endl;
		cout << x50 << endl;
		cout << x60 << endl;
	}

	return 0;
}

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

int m,n;
int p[7];

int main(){
	cin >> n;
	if(!n)
		return 0;
	for(int i=0; i<7; i++)
		p[i] = 0;
	for(int i=0; i<n; i++){
		cin >> m;
		if(m>=70)
			m = 60;
		p[m/10]++;
	}
	for(int i=0; i<7; i++)
		cout << p[i] << endl;
}

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

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

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

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

    long long int n;

    while (std::cin >> n, n) {
        std::array<long long int, 7> arr{{}};
        int age;
        for (; n--;) {
            std::cin >> age;
            age = (age > 69 ? 60 : age);
            ++arr[age / 10];
        }
        
        std::cout << arr[0] << "\n"
                  << arr[1] << "\n"
                  << arr[2] << "\n"
                  << arr[3] << "\n"
                  << arr[4] << "\n"
                  << arr[5] << "\n"
                  << arr[6] << "\n";
    }

    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	int n;
	while (cin >> n && n) {
		VI a(n); rep(i, n)cin >> a[i];
		VI data(9);

		rep(i, n) {
			int x;
			if (a[i] < 10)x = 0;
			else if (a[i] < 20)x = 1;
			else if (a[i] < 30)x = 2;
			else if (a[i] < 40)x = 3;
			else if (a[i] < 50)x = 4;
			else if (a[i] < 60)x = 5;
			else x = 6;

			data[x]++;
		}

		rep(i, 7)cout << data[i] << endl;
	}
}

C++: #include<iostream>

using namespace std;

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

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

int years[] = {9, 19, 29, 39, 49, 59, INF};
const int CNT = 7;

int main() {
	for(int N; cin >> N, N;) {
		vector<int> ans(7);
		for(int i = 0; i < N; i++) {
			int p; cin >> p;
			for(int j = 0; j < CNT; j++) {
				if(p <= years[j]) {
					ans[j]++;
					break;
				}
			}
		}
		rep(i,CNT) cout << ans[i] << endl;
	}

	return 0;
}

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

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

    long long int n;

    while (std::cin >> n, n) {
        std::array<long long int, 7> arr{{}};
        int age;
        for (; n--;) {
            std::cin >> age;
            age = (age > 69 ? 60 : age);
            ++arr[age / 10];
        }

        for (const auto& cnt : arr) {
            std::cout << cnt << std::endl;
        }
    }

    return 0;
}