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,x[100],i,a=0,b=0,c=0,d=0,e=0,f=0,g=0;
    while(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++: #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;
			f=0;
			while(num>10){
				f++;
				num-=10;
			}
			if(f>6)year[6]++;
			else year[f]++;
		}
		for(int i=0;i<7;i++)cout<<year[i]<<endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(void){

  int n;
  while( cin >> n , n ){

    int aizu[7] = {0};

    int year;
    for( int i = 0 ; i < n ; i++ ){
      cin >> year; 
      if( year > 60 ) year = 60;
      aizu[year/10]++;
    }

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

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

int main(){
  int dif[] = {10,20,30,40,50,60};
  while(1){
    int n;
    int cnt[7] = {0};
    scanf("%d",&n);
    if(n == 0) break;
    for(int i=0;i<n;i++){
      int num;
      scanf("%d",&num);
      for(int i=0;i<7;i++){
	if(i+1 == 7) cnt[i]++;
	else if(num < dif[i]) {
	  cnt[i]++;
	  break;
	}
      }
    }
    for(int i=0;i<7;i++){
      cout << cnt[i] << endl;
    }
  }
}

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

int main(){
	int n, o;

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

	return 0;
}

C++: while true do
  n = gets.to_i
  break if n == 0

  people_num = [ 0, 0, 0, 0, 0, 0, 0, ]
  n.times do 
    age = gets.to_i
    if age < 10 then
      people_num[0] += 1
    elsif age < 20 then
      people_num[1] += 1
    elsif age < 30 then
      people_num[2] += 1
    elsif age < 40 then
      people_num[3] += 1
    elsif age < 50 then
      people_num[4] += 1
    elsif age < 60 then
      people_num[5] += 1
    else
      people_num[6] += 1
    end
  end
  people_num.each do |n|
    puts n
  end
end

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

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

    long long int n;
    std::array<long long int, 71> arr;
    int age;

    while (std::cin >> n, n) {
        arr[10] = arr[20] = arr[30] = arr[40]
                = arr[50] = arr[60] = arr[70]
                = 0;
        for (; n--;) {
            std::cin >> age;
            age = (age > 69 ? 60 : age);
            ++arr[age + 10 - age % 10];
        }
   
        std::cout << arr[10] << "\n"
                  << arr[20] << "\n"
                  << arr[30] << "\n"
                  << arr[40] << "\n"
                  << arr[50] << "\n"
                  << arr[60] << "\n"
                  << arr[70] << std::endl;
    }

    return 0;
}

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

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

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	int n,a;
	while(1){
		int d[7]={};
		cin>>n;
		if(n==0) break;
		rep(i,0,n){
			cin>>a;
			if(a/10>=6) d[6]++;
			else d[a/10]++;
		}
		rep(i,0,7) o(d[i]);
	}
}

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

int main()
{
	while (1) {
		int a;
		cin >> a;
		if (a == 0)break;
		vector<int>s(7);
		for (int b = 0; b < a; b++)
		{
			string c;
			cin >> c;
			if (c.length() == 1) { s[0]++; continue; }
			if (c[0] > 53) { s[6]++; continue; }
			if (c.length() == 3) { s[6]++; continue; }
			s[c[0] - 48]++;
		}
		for (int k : s)
			cout << k << endl;
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
	const int range[] = { 0, 10, 20, 30, 40, 50, 60, 1000 };

//	cut here before submit 
//	freopen ("testcase.tsuruga", "r", stdin );
	string str = "";
	int n;

	while (getline (cin, str ) ){
		stringstream ssn(str);
		ssn >> n;
		if (n == 0){
			break;
		} // end if

		vector <int> hist (7, 0 );
		int i,j;
		for (i = 0; i < n; ++i){
			int age;
			getline (cin, str );
			stringstream ss(str);
			ss >> age;
			for (j = 0; j < 7; ++j){
				if (age >= range[j] && age < range[j+1] ){
					++hist[j];
					break;
				} // end if
			} // end for
		} // end for
		for (j = 0; j < 7; ++j){
			cout << hist[j] << endl;
		} // end for
	} // end loop
		
	return 0;
}

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

int m,n;
int p[7];

int main(){
	while(true){
		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++: #incude<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;
}