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 <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;
	while (scanf("%d", &n), n)
	{
		int visit[7];
		memset(visit, 0, sizeof(visit));
		while (n--)
		{
			int t;
			scanf("%d", &t);
			++visit[t/10 >= 6 ? 6 : t/10];
		}
		for (int i = 0; i < 7; ++i)
			printf("%d\n", visit[i]);
	}

	return 0;
}

C++: #include <iostream>
main(){int n,x,i;while(std::cin>>n,n){int dat[7]={};for(i=0;i<n;std::cin>>x,x=x/10>6?60:x,dat[x/10]++,i++);for(i=0;i<7;std::cout<<dat[i]<<'\n',i++);}}

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

int main(){
  int p[7];
  int tmp,n;

  while(1){
    cin >> n;
    if(!n)break;

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

C++: #include<cstdio>
using namespace std;
int main(){
    int n;
    while(scanf("%d",&n),n){
        int a[10] = {0};
        for(int i = 0;i < n; i++){
            int x;
            scanf("%d",&x);
            (x >= 60) ? a[0]++ : (x >= 50) ? a[1]++ : (x >= 40) ? a[2]++ : (x >= 30) ? a[3]++ : (x >= 20) ? a[4]++ : (x >= 10) ? a[5]++ : a[6]++;
        }
        for(int i = 6;i >= 0; i--)printf("%d\n",a[i]);
    }
    return 0;
}

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

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

		for (int i = 0; i < 7; i++) {
			cout << agenum[i] << endl;
		}
		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 if(x[i]>=60){
                g++;
            }
        }
        cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e<<endl<<f<<endl<<g<<endl;
    }
    return 0;
}

C++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;
typedef vector<pair<int, int> > VPII;

#define MP make_pair
#define fastIO	cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c)	for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(), c_end=c.end(); it!=c_end; ++it)

// ------------------- include, typedef, define END. -------------------

void solveAndOutput(const VI &visitorAge){
	VI ageList(7, 0);
	FOR(i, 0, visitorAge.size()){
		int temp = visitorAge[i] / 10;
		if (temp >= 7)
			temp = 6;
		ageList[temp]++;
	}
	FOR(i, 0, ageList.size()){
		cout << ageList[i] << endl;
	}
}

int main(){
	fastIO;
	int n,temp=0;
	while (cin >> n,n){
		VI visitorAge;
		visitorAge.reserve(n);
		while (n--){
			cin >> temp;
			visitorAge.push_back(temp);
		}
		solveAndOutput(visitorAge);
	}
	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

int main()
{
	int n;
	while(scanf("%d", &n), n){
		const int age[] = {10, 20, 30, 40, 50, 60};
		int cnt[7] = {0};
		rep(i, n){
			int a;
			scanf("%d", &a);
			cnt[upper_bound(age, age+6, a)-age]++;
		}
		rep(i, 7)
			printf("%d\n", cnt[i]);
	}
	return 0;
}

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

int main()
{
  int n;

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

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

int main() {
    int n;

    while (cin >> n, n) {
        int g[20] = {0};
        while (n--) {
            int age;
            cin >> age;
            g[age / 10]++;
        }
        for (int i = 0; i <= 5; i++) {
            cout << g[i] << endl;
        }
        cout << accumulate(&g[6], g+20, 0) << endl;
    }
    return 0;
}