Problem:


ヒストグラム

テンアイスクリームという名前のアイスクリーム屋さんがあります。このお店では常に 10 種類のアイスクリームが店頭に並ぶようにしています。お店の店長は商品開発の参考にするために、アイスクリームの売れ具合を表すグラフを毎日作成しています。

 そんな店長のために、あなたは各アイスクリームの販売数をグラフで表示するプログラムを作成することになりました。

 一日に販売されるアイスクリームの総数と売れたアイスクリームの番号を入力とし、アイスクリームの種類ごとに販売した数だけ * (半角アスタリスク) を出力するプログラムを作成してください。ただし、アイスクリームの種類を 0 から 9 までの整数で表わします。また、販売個数がゼロのアイスクリームは、- (半角ハイフン) をひとつ出力します。

Input

複数のデータセットの並びが入力として与えられます。入力の終わりはゼロひとつの行で示されます。
各データセットは以下の形式で与えられます。

n
c1
c2
:
cn

1 行目に一日に販売されるアイスクリームの総数 n (1 ≤ n ≤ 10000) が与えられます。続く n 行に第 i のアイスクリームの種類 ci (0 ≤ ci≤ 9) が与えられます。

データセットの数は 20 を超えません。

Output

入力データセットごとに、各アイスクリームの種類の番号順に販売数を出力します。

Sample Input

15
2
6
7
0
1
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0

Output for the Sample Input

*
*
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*



Sample input:
15
2
6
7
0
1
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0


Sample output:
*
*
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    else:
        c=[0]*10
        for i in range(n):
            a=int(input())
            c[a]+=1
        for j in range(10):
            if c[j]==0:
                print("-")
            else:
                print("*"*c[j])

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    l=[0]*10 
    for i in range(n):
        c=int(input())
        l[c] +=1
    for j in l:
        if j==0:
            print("-")
        else:
            for k in range(j):
                print("*",end='')
            print('')

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

from collections import Counter

while True:
    n = int(f.readline())
    if n == 0:
        break
    counter = Counter(int(f.readline()) for _ in range(n))
    for i in range(10):
        print('*' * counter[i] if 0 < counter[i] else '-')

Submission status: Accepted

Solution code:
while True:
 n = int(input())
 if n == 0: break
 c = [0]*10
 for i in range(n): c[int(input())] += 1
 for i in range(10):
   if c[i] == 0: print("-")
   else: print("*"*c[i])

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    else:
        x=[]
        for i in range(n):
            a=int(input())
            x.append(a)
        x.sort()
        b=0
        for j in range (0,10):
            m=x.count(b)
            
            
            if m==0:
                print("-")
                    
            else:
                print("*"*m)
            b+=1

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n==0:
        break
    l = list([0] * 10)
    for i in range(n):
        c = int(input())
        l[c] += 1
    for i in range(10):
        if l[i]==0:
            print("-")
        else:
            print("*"*l[i])

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    lst=[0]*10
    for i in range (n):
        x=int(input())
        lst [x] += 1
    for m in range (10):
        if lst[m] > 0 :
            for k in range (lst[m]) :
                print('*',end='')
            print()
        else:
            print('-')

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for i in range(n)]
    nums = [0 for i in range(10)]
    for j in range(len(a)):
        k = int(a[j])
        nums[int(a[j])] += 1
    for t in range(10):
        s = nums[t]
        if s == 0:
            print('-')
        else:
            print('*'*s)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True :
    n = int(input())
    if n == 0 :
        break
    
    cnt = list([0] * 10)
    for i in range(n) :
        cnt[int(input())] += 1
    

    for i in range(10) :
        if cnt[i] > 0 :
            for j in range(cnt[i]) :
                print("*", sep="", end="")
            print()
        else :
            print("-")

Submission status: Accepted

Solution code:
import collections as co
while True:
    n = int(input())
    if n == 0:
        break
    a = []
    for i in range(n):
        b = int(input())
        a.append(b)
    for j in range(10):
        c = a.count(j)
        if c == 0:
            print('-')
        else:
            print('*'*c)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n == 0:
        break
    a=[0]*10
    
    for i in range(n):      
        x=int(input())      
        a[x]+=1
        
    for y in range (10):
        if a[y] == 0:
            print('-')
        else:
            print('*'*a[y])

Submission status: Accepted

Solution code:
k=0
while True:
    n=int(input())
    if n==0:break
    
    L=[0,0,0,0,0,0,0,0,0,0]
    for i in range(n):
        x=int(input())
        L[x]+=1
    
    for j in range(10):
        if L[j]==0:print('-')
        else:
            for k in range(L[j]):
                print('*',end='')
            print('')

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    
    C = []
    for i in range (n):
        c = int(input())
        C.append(c)
        
    for j in range(10):
        x = C.count(j)
        if x == 0:
            print('-')
        else:
            print('*'*x)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    l=[0]*10
    for i in range(n):
        c=int(input())
        l[c]+=1
    for j in range(10):
        if l[j]==0:
            print('-')
        else:
            k=0
            while k<=l[j]-2:
                print('*',sep='',end='')
                k+=1
            print('*')

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    a=[None]*n
    for i in range(n):
        a[i]=input()
    a=list(map(int,a))
    
    for i in range(10):
        k=0
        for j in range(n):
            if a[j]==i:
                k+=1
        if k==0:
            print('-')
        else:
            print('*'*k)

Submission status: Accepted

Solution code:
while True :
    p=int(input())
    if p==0 : break
    c=[0]*10
    for k in range(p):
        a=int(input())
        c[a]=c[a]+1
    for i in range(10):
        if c[i]==0 : print("-", end="")
        else : 
            for j in range(c[i]): 
                print("*", end="")
        print("")

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    a = [0] * 10
    for i in range(n):
        c = int(input())
        a[c] += 1
    for c in a:
        if c == 0:
            print('-')
        else:
            print('*'*c)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    lst=[]
    for i in range(n):
        lst.append(int(input()))
    for i in range(10):
        x=lst.count(i)
        if x==0:
            print("-")
        else:
            print("*"*x)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n == 0:
        break
    else:
        x=[]
        for i in range (n):
            A=int(input())
            x.append(A)
        x1=sorted(x)
        b=0
        for j in range (0,10):
            m=x1.count(b)
            
            if m==0:
                print("-")
                    
            else:
                print("*"*m)
            b+=1

Submission status: Accepted

Solution code:
def pri(x):
    if x>0:
        print('*'*x)
    else:
        print('-')
while True:
    n = int(input())
    if n ==0:
        break
    a=[]
    b=c=d=e=f=g=h=k=l=m=0
    for i in range(n):
        a.append(int(input()))
    a.sort()
    for j in range(n):
        if a[j]==0:
            b += 1
        if a[j]==1:
            c += 1
        if a[j]==2:
            d += 1
        if a[j]==3:
            e += 1
        if a[j]==4:
            f += 1
        if a[j]==5:
            g += 1
        if a[j]==6:
            h += 1
        if a[j]==7:
            k += 1
        if a[j]==8:
            l += 1
        if a[j]==9:
            m += 1
    pri(b)
    pri(c)
    pri(d)
    pri(e)
    pri(f)
    pri(g)
    pri(h)
    pri(k)
    pri(l)
    pri(m)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    a=[]

    for i in range(n):
        x=input()
        a.append(x)

    for i in range(10):
        x=a.count(str(i))
        if x==0:
            print("-")
    
        else :
            print("*"*x)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    con=[0]*10

    for i in range(n):
        con[int(input())]+=1
    
    for i in range(10):
        if con[i]==0:
            print("-")
        else :
            for j in range(con[i]-1):
                print("*",end="")
            print("*")

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    
    l=[0]*10
    for i in range(n):
        x=int(input())
        l[x]+=1
        
    for i in range(10):
        if l[i]==0:
            print("-")
        else:
            print("*"*l[i])

Submission status: Accepted

Solution code:
j = 0
while j < 20:
    n = int(input())
    if n == 0:
        break
        
    ice = []
    for i in range(n):
        a = int(input())
        ice.append(a)

    for i in range(10):
        b = ice.count(i)
        if b == 0:
            print('-')
        else:
            print('*'*b)

Submission status: Accepted

Solution code:
while True:   
    n=int(input())
    if n==0: break
    c=[0]*10
    for i in range(n):
        c[int(input())]+=1
    for j in range(10):
        if c[j]==0:
            print('-')
        else:
            print('*'*c[j])

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    else:
        c=[int(input()) for i in range(n)]
        j=0
        for j in range(10):
            j+=1
            x=c.count(j-1)
            if x==0:
                print("-")
            else:
                print("*"*x)

Submission status: Accepted

Solution code:
# coding: utf-8
# 51

while True:
    n = int(input())
    if n==0:
        break
    c = [int(input()) for i in range(n)]
    m =max(c)
    #print(m)
    k = int(0)
    A = '*'
    for i in range(m+1):
        k = c.count(i)
        if k==0:
            print('-')
        else:
            print(A*k)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: 
        break
    
    a = [0]*10

    for i in range(n): 
        a[int(input())] += 1
    for i in range(10):
        if a[i] == 0: 
            print("-")
        else: 
            print("*"*a[i])

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
   l = [0]*10
   n = int(input())
   if n == 0: break

   for i in range(n):
      c = int(input())
      l[c] += 1
   #print(l)

   for i in range(10):
      if l[i] == 0:
         print("-")
      else:
         for j in range(l[i]):
            print("*", end = "")
         print("")

Submission status: Accepted

Solution code:

while True:
    a = [0]*11
    
    n = int(input())
    if n==0:
        break
    
    for i in range(n):
        b = int(input())
        a[b] += 1
        
    for i in range(10):
        if a[i]==0:
            print("-")
        else:
            print("*"*a[i])

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    
    if n==0:
        break
    
    clist = []
    for i in range(n):
        c = int(input())
        clist.append(c)
    
    klist = []
    for i in range(10):
        kosu = clist.count(i)
        klist.append(kosu)
    
    for i in range(10):
        if klist[i]>0:
            print('*'*klist[i])
        if klist[i]==0:
            print('-')

Submission status: Accepted

Solution code:
#0219
while True:
    n = int(input())
    if n == 0:
        break
    c = [int(input()) for c in range(n)]
    for i in range(10):
        x = c.count(i)
        for j in range(x):
            print('*',end='')
        if x == 0:
            print('-',end='')
        print()

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    cnt=[0]*10
    for i in range(n):
        c=int(input())
        cnt[c]+=1
    for c in cnt:
        if c>0:
            print('*'*c)
        else:
            print('-')

Submission status: Accepted

Solution code:
while 1:
  n = int(input())
  if n == 0:
    break
  x = [0 for i in range(10)] 
  for i in range(n):
    c = int(input())
    x[c] += 1

  for i in range(10):
    count = '*' * x[i] 
    if len(count) == 0:
      print("-")
    else:
      print(count)

Submission status: Accepted

Solution code:
while True:
    num = int(input())
    if num == 0:break
    else:
        #要素0が10個入ったリストを作る
        num_list = [0 for _ in range(10)]
        
        #標準入力で買われたアイスの番号を入力しリストに加える
        for _1 in range(num):
            n = int(input())
            num_list[n] += 1
            
        #0なら"-"を出力する
        for i in range(0,10):
            if num_list[i] == 0:print("-")
            
        #0でないなら"*"を買われた数出力する
            else:
                for j in range(num_list[i]):
                    print("*",end="")
                print()

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break
    f = [0]*10
    for i in range(n): f[int(input())] += 1
    for i in range(10):
        if f[i] == 0: print('-')
        else: print('*'*f[i])

Submission status: Accepted

Solution code:
while True :
    n = int(input())
    if n == 0 :
        break
    
    ice = list([0] * 10)
    for i in range(n) :
        ice[int(input())] += 1
    

    for i in range(10) :
        if ice[i] > 0 :
            for j in range(ice[i]) :
                print("*", sep="", end="")
            print()
        else :
            print("-")

Submission status: Accepted

Solution code:
while True:
    y=[]
    n=int(input())
    if n==0:
        break
    for i in range(1,n+1):
        x=int(input())
        y.append(x)
    for i in range(0,10):
        s=0
        if i in y:
            s=y.count(i)
        if s!=0:
            print("*"*s)
        else:
            print("-")

Submission status: Accepted

Solution code:
while True :
    n = int(input())
    
    if n == 0 :
        break
    else :  
        C = [0 for i in range(10)]
        
        for i in range(n) :
            C[int(input())] += 1
            
        for j in range(10) :
            if C[j] == 0 :
                print("-")
            else :
                for i in range(C[j]) :
                    print("*", end = "")
                print()

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    ices = [0 for i in range(10)]
    for i in range(n):
        ices[int(input())] += 1
    for ice in ices:
        if ice == 0:
            print("-")
        else:
            print("*"*ice)

Submission status: Accepted

Solution code:
from collections import defaultdict

while True:
    n = int(input())
    if n == 0:
        break
    ice = defaultdict(int)
    
    for _ in range(n):
        i = int(input())
        ice[i] += 1
    
    for i in range(10):
        if ice[i] == 0:
            print("-")
        else:
            print("*" * ice[i])

Submission status: Accepted

Solution code:
while True:
  n =int(input())
  if n==0:
    break
  A=[0]*10
  for i in range(n):
    A[int(input())]+=1
  #print(A)

  for i in range(10):
    if A[i]==0:
      print("-")
    else:
      print("*"*A[i])

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if n==0: break
    a=[0]*10
    while n:
        n-=1
        a[int(input())]+=1
    for i in range (10):
        for j in range(a[i]):
             
            print('*',end="")
        if a[i]==0:
            print('-',end="")
        print()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A Popular Ice-cream Shop
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0219

"""
import sys


def solve(n):
    sales = [0] * 10
    for _ in range(n):
        sales[int(input())] += 1
    return ['*' * s if s else '-' for s in sales]


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        ans = solve(n)
        print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
while True :
    n = int(input())
    if n == 0 : break
    numList = [0 for i in range(10)] 
    for i in range(n) :
        c = int(input())
        numList[c] += 1

    for i in range(10) :
        cnt = '*' * numList[i] 
        if len(cnt) == 0 : print("-")
        else : print(cnt)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break

    dic = {
        0: 0, 1: 0, 2: 0, 3: 0, 4: 0,
        5: 0, 6: 0, 7: 0, 8: 0, 9: 0
    }
    for _ in range(n):
        c = int(input())
        dic[c] += 1

    for v in dic.values():
        print('*' * v if v != 0 else '-')

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    if n == 0:
        break

    ice = [0] * 10
    for _ in range(n):
        c = int(input())
        ice[c] += 1

    for i in ice:
        if i == 0:
            print("-")
        else:
            print("*" * i)

Submission status: Accepted

Solution code:
while True:

    N = int(input())
    if N == 0:
        break

    ans = [0 for i in range(10)]
    for l in range(N):
        k = int(input())
        ans[k] += 1

    for i in range(10):
        if ans[i] == 0:
            print("-")
        else:
            for j in range(ans[i]):
                print("*",end="")
            print("")

Submission status: Runtime Error

Solution code:
n=int(input())
x=[0 for i in range(10)]
while True:
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if a==0:
      x[0]+=1
    elif a==1:
      x[1]+=1
    elif a==2:
      x[2]+=1
    elif a==3:
      x[3]+=1
    elif a==4:
      x[4]+=1
    elif a==5:
      x[5]+=1 
    elif a==6:
      x[6]+=1
    elif a==7:
      x[7]+=1
    elif a==8:
      x[8]+=1
    else:
      x[9]+=1
  for i in range(10):
    if x[i]==0:
      print('{}'.format('-')) 
    else:
      print('{}'.format(x[i]*'*'))

Submission status: Runtime Error

Solution code:
n=int(input())
x=[0 for i in range(10)]
while True:
  if n==0:
    break
  for i in range(n):
    a=int(input())
    x[a]+=1
  for i in range(10):
    if x[i]==0:
      print('{}'.format('-')) 
    else:
      print('{}'.format(x[i]*'*'))

Submission status: Runtime Error

Solution code:
while True:
    q={}
    a=input()
    if a==0:break
    for i in range(10): q[i]=0
    for i in range(a): q[input()]+=1
    for i in range(10):  print "*"*q[i] if q[i] != 0 else "-"

Submission status: Runtime Error

Solution code:
while True:
    n=input()
    if n==0:break
    L=[0]*10
    for i in range(n):
        L[input()]+=1
    for i in range(10):
        print "*"*L[i] if L[i]!=0 else "-"

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':




&#160; &#160; while True:








&#160; &#160; &#160; &#160; n = int(raw_input())
&#160; &#160; &#160; &#160; if n == 0:
&#160; &#160; &#160; &#160; &#160; &#160; break




&#160; &#160; &#160; &#160; data = [0 for a in range(10)]
&#160; &#160; # &#160; &#160;print data




&#160; &#160; &#160; &#160; for m in range(n):
&#160; &#160; &#160; &#160; &#160; &#160; inp = int(raw_input())




&#160; &#160; &#160; &#160; &#160; &#160; data[inp-1] += 1
&#160; &#160; # &#160; &#160; &#160; &#160;print data




&#160; &#160; &#160; &#160; for m in range(10):




&#160; &#160; &#160; &#160; &#160; &#160; if data[m] == 0:
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; print '-'




&#160; &#160; &#160; &#160; &#160; &#160; else:
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for c in range(data[m]):
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; print '*',




&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; print

Submission status: Runtime Error

Solution code:
n = int(input())                                                                                                                                                                                         
data = [0] * n                                                                                                                                                                                           
                                                                                                                                                                                                             
for a in range(n):                                                                                                                                                                                       
　t = int(input())                                                                                                                                                                                     
  data[t] += 1                                                                                                                                                                                         
                                                                                                                                                                                                             for a in range(n):                                                                                                                                                                                       
　if data[a] == 0:                                                                                                                                                                                     
  　print('-')                                                                                                                                                                                          　else:                                                                                                                                                                                                
　　for t in range(data[a]):                                                                                                                                                                         
　　　print('*', end='')                                                                                                                                                                           
　　print()

Submission status: Runtime Error

Solution code:
n = int(raw_input())                                                                                                                                                                                         
data = [0] * n                                                                                                                                                                                           
                                                                                                                                                                                                             
for a in range(n):                                                                                                                                                                                       
　t = int(raw_input())                                                                                                                                                                                     
  data[t] += 1                                                                                                                                                                                         
                                                                                                                                                                                                             for a in range(n):                                                                                                                                                                                       
　if data[a] == 0:                                                                                                                                                                                     
  　print '-'                                                                                                                                                                                           　else:                                                                                                                                                                                                
　　for t in range(data[a]):                                                                                                                                                                         
　　　print '*',                                                                                                                                                                           
　　print

Submission status: WA: Presentation Error

Solution code:
if __name__ == '__main__':

    while True:

        n = int(raw_input())
        if n == 0:
            break

        data = [0 for a in range(10)]
#        print data

        for m in range(n):
            inp = int(raw_input())

            data[inp] += 1
#            print data

        for m in range(10):

            if data[m] == 0:
                print '-'

            else:
                for c in range(data[m]):
                    print '*',

                print

Submission status: WA: Presentation Error

Solution code:
while(True):
    n = int(raw_input())
    if n == 0:
        break
    data = [0] * 10

    for a in range(n):
       t = int(raw_input())
       data[t] += 1
    
    for a in range(10):
        if data[a] == 0:
            print '-'
        else:
            for t in range(data[a]):
                print '*',
            print