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<string.h>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    int n;
    while(cin>>n&&n!=0){
        int x,a=0,b=0,c=0,d=0,e=0,f=0,g=0;
        for(int i=0;i<n;i++){
            cin>>x;
            if(x<10){
                a++;
            }
            else if(x>=10&&x<20){
                b++;
            }
            else if(x>=20&&x<30){
                c++;
            }
            else if(x>=30&&x<40){
                d++;
            }
            else if(x>=40&&x<50){
                e++;
            }
            else if(x>=50&&x<60){
                f++;
            }
            else if(x>=60){
                g++;
            }
        }
        cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e<<endl<<f<<endl<<g<<endl;
    }
    return 0;
}

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

int main(){
    vector<int> array(7);

    for(int i=0; i<7; i++){
        array[i] = 0;
    }

    int n;
    int tmp;

    while(cin >> n, n != 0){
        for(int i=1; i<=n; i++){
            cin >> tmp;

            if(tmp < 10){
                array[0]++;
            }else if(tmp <= 19){
                array[1]++;
            }else if(tmp <= 29){
                array[2]++;
            }else if(tmp <= 39){
                array[3]++;
            }else if(tmp <= 49){
                array[4]++;
            }else if(tmp <= 59){
                array[5]++;
            }else{
                array[6]++;
            }
        }
        for(int i=0; i<7; i++){
            cout << array[i] << endl;
            array[i] = 0;
        }
    }
    return 0;
}

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    while(cin>>n,n){
        vi v(7,0);
        rep(i,n){
            int gotiusa_is_a_god_especially_tiya;
            cin>>gotiusa_is_a_god_especially_tiya;
            if(gotiusa_is_a_god_especially_tiya>=60)gotiusa_is_a_god_especially_tiya=60;
            v[gotiusa_is_a_god_especially_tiya/10]++;
        }
        rep(i,7)cout<<v[i]<<endl;
    }
}

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

int main(){

  long long int n;

  while(cin >> n, n){

    long long int x,a[10] = {0};

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

      if(x >= 60) a[6]++;
      else if(x >= 50) a[5]++;
      else if(x >= 40) a[4]++;
      else if(x >= 30) a[3]++;
      else if(x >= 20) a[2]++;
      else if(x >= 10) a[1]++;
      else a[0]++;

    }

    for(int i=0;i<7;i++) cout << a[i] << endl;

  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>
#include <map>
using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n, n)
    {
        vector<int> cnt(7, 0);
        for(int i = 0; i < n; i++)
        {
            int x; cin >> x;
            bool flag = false;
            for(int age = 10; age <= 60; age += 10)
            {
                if(x < age)
                {
                    cnt[age / 10 - 1]++;
                    flag = true;
                    break;
                }
            }
            if(flag == false) cnt[6]++;
        }
        for(int i = 0; i < 7; i++) cout << cnt[i] << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int year[10]={},n,f,num;
	while(cin>>n,n!=0){
		for(int i=0;i<10;i++)year[i]=0;
		for(int i=0;i<n;i++){
			cin>>num;
			num++;
			f=0;
			f=num/10;
			if(f>6)year[6]++;
			else year[f]++;
		}
		for(int i=0;i<7;i++)cout<<year[i]<<endl;
	}
}

C++: #include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
int main() {
    int n, t;
    int arr[7];
    for (; ;) {
        scanf("%d", &n);
        if (n == 0) break;
        fill(arr, arr+7, 0);
        for (int i = 0; i < n; i++) {
            scanf("%d", &t);
            t/=10;
            if (t >= 6) arr[6]++;
            else arr[t]++;
        }
        for (int i = 0; i<= 6; i++) printf("%d\n", arr[i]);

    }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	long long int n,i,c,w[10],h;
	c=0;
	while(1){
		scanf("%lld",&h);
		if(h==0) break;
		for(i=0;i<10;i++){
			w[i]=0;
		}	
		for(i=0;i<h;i++){
			scanf("%lld",&n);
			if(n>=0&&n<=9){
				w[0]+=1;
			}
			if(n>=10&&n<=19){
				w[1]+=1;
			}
			if(n>=20&&n<=29){
				w[2]+=1;
			}
			if(n>=30&&n<=39){
				w[3]+=1;
			}
			if(n>=40&&n<=49){
				w[4]+=1;
			}
			if(n>=50&&n<=59){
				w[5]+=1;
			}
			if(n>=60){
				w[6]+=1;
			}	
		}
		for(i=0;i<7;i++){
			printf("%lld\n",w[i]);
		}
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main() {
	
	int n;
	
	while(cin >> n) {
	
	int A[7] = {};
	
	if( n == 0)
	break;
	
	for(int i=0;i<n;i++) {
		
		int age;
		
		cin >> age;
		
		if( age >= 0 & age <10)
		A[0]++;
		
		if( age >= 10 & age <19)
		A[1]++;
		
		if( age >= 20 & age <29)
		A[2]++;
		
		if( age >= 30 & age <39)
		A[3]++;
		
		if( age >= 40 & age <49)
		A[4]++;
		
		if( age >= 50 & age <59)
		A[5]++;
		
		if( age >= 60)
		A[6]++;
	}
	for(int i=0;i<7;i++)
	cout << A[i] << "\n";
	
}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<stack>
#include<queue>

using namespace std;

int main(){
	int n,t;
	while(scanf("%d",&n)){
		if(n==0) break;
		int d[7]={};
		for(int i=0;i<n;i++){
			scanf("%d",&t);
			if(t>=0&&t<=9) d[0]++;
			else if(t>=10&&t<=19) d[1]++;
			else if(t>=20&&t<=29) d[2]++;
			else if(t>=30&&t<=39) d[3]++;
			else if(t>=40&&t<=49) d[4]++;
			else if(t>=50&&t<=59) d[5]++;
			else d[6]++;
		}
		for(int i=0;i<7;i++) printf("%d\n",d[i]);
	}
}