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,age,data[7];
  while(1){
    cin>>n;
    if(n==0)break;
    for(int i=0;i<7;i++){
      data[i]=0;
    }
    for(int i=0;i<n;i++){
      cin>>age;
      if(age>=0&&age<=9)data[0]++;
      if(age>=10&&age<=19)data[1]++;
      if(age>=20&&age<=29)data[2]++;
      if(age>=30&&age<=39)data[3]++;
      if(age>=40&&age<=49)data[4]++;
      if(age>=50&&age<=59)data[5]++;
      if(age>=60)data[6]++;
    }
    for(int i=0;i<7;i++){
      cout<<data[i]<<endl;
    }
  }
  return 0;
}

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

int main(){
	int n,t,a[7],y;
	while(1){
		cin >> n;
		if(n==0){
			return 0;
		}
		for(t=0;t<7;t++){
			a[t]=0;
		}
		for(t=0;t<n;t++){
			cin >> y;
			y=y/10;
			if(y>6){
				y=6;
			}
			a[y]++;
		}
		for(t=0;t<7;t++){
			cout << a[t] << endl;
		}

	}
}

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 < 70 ? age : 60);
            ++arr[age / 10];
        }
        
        for (const auto& cnt : arr) {
            std::cout << cnt << std::endl;
        }
    }

    return 0;
}

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

C++: #include<stdio.h>
int main(void)
{
	int a,s,d[8],f,g,h,i,j;
	scanf("%d",&a);
	while(a!=0){
		for(i=1;i<=7;i++){
			d[i]=0;
		}
		for(i=1;i<=a;i++){
			f=0;
			scanf("%d",&s);
			if(s>=60){
				d[7]++;
				f++;
			}
			if(f==0&&s>=50){
				d[6]++;
				f++;
			}
			if(f==0&&s>=40){
				d[5]++;
				f++;
			}
			if(f==0&&s>=30){
				d[4]++;
				f++;
			}
			if(f==0&&s>=20){
				d[3]++;
				f++;
			}
			if(f==0&&s>=10){
				d[2]++;
				f++;
			}
			if(f==0){
				d[1]++;
				f++;
			}
		}
		for(i=1;i<=7;i++){
			printf("%d\n",d[i]);
		}
		scanf("%d",&a);
	}
	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
using namespace std;
int main(){
	
	int n,a;
	
	while(cin>>n,n!=0){
		int b;
		long long int p[7]={0};
		for(int i=0;i<n;i++){
			cin>>a;
			if(a<10)
				b=0;
			else if(a<20)
				b=1;
			else if(a<30)
				b=2;
			else if(a<40)
				b=3;
			else if(a<50)
				b=4;
			else if(a<60)
				b=5;
			else 
				b=6;
			
			p[b]++;
				
		}
		
		for(int i=0;i<7;i++)
			cout<<p[i]<<endl;
	}
	
	
	
	

}

C++: #include <cassert>// c
#include <ctime>
#include <iostream>// io
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>// container
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <algorithm>// other
#include <utility>
#include <complex>
#include <numeric>
#include <functional>
#include <random>
#include <regex>

using namespace std;
typedef long long ll;

#define ALL(c) (c).begin(),(c).end()
#define FOR(i,l,r) for(int i=(int)l;i<(int)r;++i)
#define REP(i,n) FOR(i,0,n)
#define FORr(i,l,r) for(int i=(int)r-1;i>=(int)l;--i)
#define REPr(i,n) FORr(i,0,n)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end())
//debug
#define DUMP(x)  cerr << #x << " = " << (x)
#define LINE()    cerr<< " (L" << __LINE__ << ")"

template<typename T,typename U> T pmod(T x,U M){return (x%M+M)%M;}

stringstream ss;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	ss   <<fixed <<setprecision(20);
	cout <<fixed <<setprecision(20);
	cerr <<fixed <<setprecision(20);

	while(true){
	    int n;cin >> n;if(n==0)break;
	    vector<int> bs(10);
	    REP(i,n){
		int v;cin >> v;
		bs[min(v/10,6)]++;
	    }
	    REP(i,7)cout << bs[i] <<endl;
	}

 	return 0;
 }

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int n,a,data[7];
	while(cin>>n,n){
		memset(data,0,sizeof(data));
		for(int i=0;i<n;i++){
			cin>>a;
			if(a<10)data[0]++;
			else if(a<20)data[1]++;
			else if(a<30)data[2]++;
			else if(a<40)data[3]++;
			else if(a<50)data[4]++;
			else if(a<60)data[5]++;
			else data[6]++;
		}
		for(int i=0;i<7;i++){
			cout<<data[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{{}};

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

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

    return 0;
}

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

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int n, a, p[7];
int main() {
	while (true) {
		scanf("%d", &n);
		if (n == 0) break;
		for (int i = 0; i < n; i++) scanf("%d", &a), p[min(a / 10, 6)]++;
		for (int i = 0; i < 7; i++) printf("%d\n", p[i]);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,old,gene[7];
    while(cin>>n&&n!=0){
        for(int i=0;i<7;i++)gene[i]=0;
        for(int i=0;i<n;i++){
            cin>>old;
            for(int j=1;j<7;j++){
                if(old-j*10<0){
                        gene[j-1]++;
                        break;
                }
                else if(j==6)gene[6]++;
            }
        }
        for(int i=0;i<7;i++)cout<<gene[i]<<endl;
    }
}

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

int main(){
    int n;
    while(cin >> n , n){
        int ans[7];
        memset(ans,0,sizeof(ans));
        for(int i=0; i<n; i++){
            int o; cin >> o;
            int ind = min(o/10,6);
            ans[ind]++;
        }
        for(int i=0; i<7; i++)
            cout << ans[i] << endl;
    }
}

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

int main() {
    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 < 60 ? age : 60);
            ++arr[age / 10];
        }

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

    return 0;
}