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
		}
		a := make([]int, 10)
		for i := 0; i < n; i++ {
			scanner.Scan()
			c, _ := strconv.Atoi(scanner.Text())
			a[c]++
		}
		for _, v := range a {
			if v == 0 {
				fmt.Println("-")
				continue
			}
			for i := 0; i < v; i++ {
				if i == v-1 {
					fmt.Println("*")
				} else {
					fmt.Print("*")
				}
			}
		}
	}
}

C++: import java.util.Scanner

import scala.collection.Searching._
import scala.annotation.tailrec
import scala.collection.immutable.{NumericRange, Queue}
import scala.collection.mutable
import scala.io.StdIn.readLine

class IUnionFind(val size: Int) {

  private case class Node(var parent: Option[Int], var treeSize: Int)

  private val nodes = Array.fill[Node](size)(new Node(None, 1))

  def union(t1: Int, t2: Int): IUnionFind = {
    if (t1 == t2) return this

    val root1 = root(t1)
    val root2 = root(t2)
    if (root1 == root2) return this

    val node1 = nodes(root1)
    val node2 = nodes(root2)

    if (node1.treeSize < node2.treeSize) {
      node1.parent = Some(t2)
      node2.treeSize += node1.treeSize
    } else {
      node2.parent = Some(t1)
      node1.treeSize += node2.treeSize
    }
    this
  }

  def connected(t1: Int, t2: Int): Boolean = t1 == t2 || root(t1) == root(t2)

  @tailrec
  private def root(t: Int): Int = nodes(t).parent match {
    case None => t
    case Some(p) => root(p)
  }
}


object Main {
  def solve(sc: => Scanner): Unit = {
    val N = sc.nextInt
    if (N != 0) {
      val A = Array.fill(N)(sc.nextInt).groupBy(x => x).map(x => (x._1, "*" * x._2.length))
      for (i <- Range(0, 10)) {
        println(A.getOrElse(i, "-"))
      }
      solve(sc)
    }
  }

  def gcd(i: Long, j: Long): Long = {
    if (i < j) (gcd(j, i)) else (if (j == 0) (i) else (gcd(j, i % j)))
  }

  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    solve(sc)
  }
}

C++: #include<stdio.h>
int main(void)
{
    int n, i, masatoy[10000];
    int str[10] = { 0,0,0,0,0,0,0,0,0,0 }, k;
    scanf("%d", &n);
    while (n > 0) {
        for (i = 0; i < n; i++) {
            scanf("%d", &masatoy[i]);
            for (k = 0; k <= 9; k++) {
                if (masatoy[i] == k) {
                    str[k]++;
                }
            }

        }
        for (i = 0; i <= 9; i++) {
            if (str[i] == 0) {
                printf("-\n");
            }
            else {
                for (k = 0; k < str[i]; k++) {
                    printf("*");
                }
                printf("\n");
            }

        }
        scanf("%d", &n);
        for (i = 0; i <=9; i++) {
            str[i] = 0; 
     
        }
    }
    return 0;
}

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

using namespace std;

int main()
{
	int N, A; vector<int> C;

	while (true)
	{
		cin >> N;

		if (N == 0) { break; }

		C = vector<int>(10, 0);

		for (int i = 0; i < N; i++)
		{
			cin >> A;

			C[A]++;
		}

		for (int i = 0; i < 10; i++)
		{
			if (C[i] == 0)
			{
				cout << '-' << endl;
			}
			else
			{
				for (int j = 0; j < C[i]; j++)
				{
					cout << '*';
				}

				cout << endl;
			}
		}
	}

	return 0;
}

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

int main() {

  int n;
  while( cin >> n, n ) {
    int data[10000]={0};
    for(int i=0; i<n; i++) {
      int num;
      cin >> num;
      data[num]++;
    }

    for(int i=0; i<10; i++) {
      if( !data[i] ) cout << '-' << endl;
      else {
	for(int j=0; j<data[i]; j++) {
	  cout << '*';
	}
	cout << endl;
      }
    }
  }
}

C++: #include<stdio.h>

int main(void)
{
	int ice[10],n,i,u,j;
	while(1){
		scanf("%d",&n);
		if(n==0)break;//終了条件
		for(i=0;i<10;i++) 
			ice[i]=0;
		
		for(i=0;i<n;i++){
			scanf("%d",&u);
			ice[u]++;
		}
		for(i=0;i<10;i++){
			if(ice[i]==0) printf("-\n");
			else {
				for(j=0;j<ice[i]-1;j++)
					printf("*");

				printf("*\n");
			}
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n;

	while (cin >> n, n) {
		int sales[10] = {0};
		for (int i = 0; i < n; ++i) {
			int no; cin >> no;
			++sales[no];
		}

		for (int i = 0; i < 10; ++i)
			if (sales[i]) {
				for (int j = 0; j < sales[i]; ++j)
					cout << "*";
				cout << endl;
			}
			else
				cout << "-" << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<30;

int main() {
  int n;
  while(cin >> n,n) {
    int a[10] = {};
    REP(i,n) {
      int b;
      cin >> b;
      a[b]++;
    }
    REP(i,10) {
      if (a[i]) {
        cout << string(a[i],'*') << endl;
      } else
        cout << "-" << endl;
    }
  }
}

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

int list[12];
int main(){
	int d;
	while(cin>>d&&d){
//		cout<<"-------- "<<d<<endl;
		for(int i=0;i<12;i++)list[i]=0;
		for(;d>0;d--){
			int n;
			cin>>n;
			list[n]++;
		}
		for(int i=0;i<10;i++){
	//		cout<<"["<<i<<"]";
			if(list[i]==0)cout<<"-";
			for(int j=0;j<list[i];j++){
				cout<<"*";
			}
			cout<<endl;
		}

	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


int main() {
	int n, m;
	while (cin >> n && n > 0) {
		vi v(10, 0);
		rep(i, n) {
			cin >> m;
			v[m]++;
		}
		rep(i, 10) {
			if (v[i] == 0) {
				cout << "-" << endl;
			}
			else {
				rep(j, v[i]) {
					cout << "*";
				}
				cout << endl;
			}
		}
	}
}

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

int main(){
	int n;
	int ice[10000];
	int k[16];

	while(cin >>n,n){

		for(int i=0;i<16;i++){
			k[i]=0;
		}

		for(int i=0;i<n;i++){
			cin >>ice[i];
		}


		for(int i=0;i<n;i++){
			switch(ice[i]){
				case 0: k[0]++; break;
				case 1: k[1]++; break;
				case 2: k[2]++; break;
				case 3: k[3]++; break;
				case 4: k[4]++; break;
				case 5: k[5]++; break;
				case 6: k[6]++; break;
				case 7: k[7]++; break;
				case 8: k[8]++; break;
				case 9: k[9]++; break;
			}
		}
/*
		cout <<endl;
		for(int i=0;i<10;i++)
			cout << k[i] <<endl;
*/		

		for(int i=0;i<10;i++){
			if(k[i] > 0){
				cout <<endl;
				for(int j=0;j<k[i];j++){
					cout <<"*";
				}
//				cout << endl;
			}else {
				cout <<endl;
				cout <<"-";
			}
		}

	}


	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#define INF 100000000
#define MOD 1000000007
using namespace std;


int main(){
    while(true){
        int n;
        cin >> n;
        if(n==0){break;}
        
        int num[10]={};
        for(int i=0; i<n; i++){
            int a;
            cin >> a;
            num[a]++;
        }
        
        for(int i=0; i<10; i++){
            for(int k=0; k<num[i]; k++){
                cout<<'*';
            }
            if(num[i]==0){cout<<'-';}
            cout<<endl;
        }
    }
    
    return 0;
}