Problem:


鶴ヶ城

 会津若松市のシンボルである鶴ヶ城は、蒲生氏郷が本格的な天守閣を築城し、「鶴ヶ城」と名付けました。天守閣からは会津盆地が一望できます。また、晴れた日には、白虎隊で有名な飯盛山の山頂から鶴ヶ城を見ることができます。

 会津若松市の今後の広報活動の参考にするため、鶴ヶ城に訪れた来場者について、年代調査をすることにしました。来場者の年齢を入力とし、下記の年齢区分別に人数を出力するプログラムを作成してください。

  区分     年齢

10歳未満  0  ~ 9

 10代  10  ~ 19

 20代  20  ~ 29

 30代  30  ~ 39

 40代  40  ~ 49

 50代  50  ~ 59

60歳以上 60  ~

Input

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

n
a1
a2
:
an

1 行目に来場者の人数 n (1 ≤ n ≤ 1000000)、続く n 行に i 人目の来場者の年齢 ai ( 0 ≤ ai ≤ 120 ) が与えられます。

Output

データセット毎に以下の形式で人数を出力します。

1 行目: 10 歳未満の人数

2 行目: 10 代の人数

3 行目: 20 代の人数

4 行目: 30 代の人数

5 行目: 40 代の人数

6 行目: 50 代の人数

7 行目: 60 歳以上の人数

Sample Input

8
71
34
65
11
41
39
6
5
4
67
81
78
65
0

Output for the Sample Input

2
1
0
2
1
0
2
0
0
0
0
0
0
4



Sample input:
8
71
34
65
11
41
39
6
5
4
67
81
78
65
0


Sample output:
2
1
0
2
1
0
2
0
0
0
0
0
0
4

Submission status: Wrong Answer

Solution code:
n=int(input())
x=[0 for i in range(7)]
for i in range(n):
  a=int(input())
  if 0<=a<10:
    x[0]+=1
  elif 10<=a<20:
    x[1]+=1
  elif 20<=a<30:
    x[2]+=1
  elif 30<=a<40:
    x[3]+=1
  elif 40<=a<50:
    x[4]+=1 
  elif 50<=a<60:
    x[5]+=1
  else:
    x[6]+=1
for i in range(7):
  if x[i]==0:
    print(0)
  else:
    print('{}'.format(x[i]))

Submission status: Wrong Answer

Solution code:

if __name__ == '__main__':

	n = int(raw_input(''))

	a = [0] * 7

	for i in range(n):
		tmp = int(raw_input(''))
		if 0 <= tmp and tmp <= 9:
			a[0] += 1
		elif 10 <= tmp and tmp <= 19:
			a[1] += 1
		elif 20 <= tmp and tmp <= 29:
			a[2] += 1
		elif 30 <= tmp and tmp <= 39:
			a[3] += 1
		elif 40 <= tmp and tmp <= 49:
			a[4] += 1
		elif 50 <= tmp and tmp <= 59:
			a[5] += 1
		elif tmp <= 60:
			a[6] += 1

	for i in a:
		print i

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0: break
    ans = [0,0,0,0,0,0,0]
    for i in range(n):
        age = input()
        if age <= 9:
            ans[0] = ans[0]+1
        elif age <= 19:
            ans[1] = ans[1]+1
        elif age <= 29:
            ans[2] = ans[2]+1
        elif age <= 39:
            ans[3] = ans[3]+1
        elif age <= 49:
            ans[4] = ans[4]+1
        elif age <= 59:
            ans[5] = ans[5]+1
        else:
            ans[6] = ans[6]+1
    else:
        for c in ans:
            print c

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0: break
    ans = [0,0,0,0,0,0,0]
    for i in xrange(n):
        age = input()
        if age <= 9:
            ans[0] = ans[0]+1
        elif age <= 19:
            ans[1] = ans[1]+1
        elif age <= 29:
            ans[2] = ans[2]+1
        elif age <= 39:
            ans[3] = ans[3]+1
        elif age <= 49:
            ans[4] = ans[4]+1
        elif age <= 59:
            ans[5] = ans[5]+1
        else:
            ans[6] = ans[6]+1
    else:
        for c in ans:
            print c

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0: break
    ans = [0,0,0,0,0,0,0]
    for i in xrange(n):
        age = input()
        if age <= 9:
            ans[0] += 1
        elif age <= 19:
            ans[1] += 1
        elif age <= 29:
            ans[2] += 1
        elif age <= 39:
            ans[3] += 1
        elif age <= 49:
            ans[4] += 1
        elif age <= 59:
            ans[5] += 1
        else:
            ans[6] += 1
    else:
        for c in ans:
            print c

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0: break
    ans = [0,0,0,0,0,0,0]
    for i in xrange(n):
        age = input()
        if age <= 9:
            ans[0] += 1
        elif age <= 19:
            ans[1] += 1
        elif age <= 29:
            ans[2] += 1
        elif age <= 39:
            ans[3] += 1
        elif age <= 49:
            ans[4] += 1
        elif age <= 59:
            ans[5] += 1
        else:
            ans[6] += 1
    else:
        for i in xrange(len(ans)):
            print ans[i]

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0: break
    ans = [0,0,0,0,0,0,0]
    for i in xrange(n):
        age = input()
        if age <= 9:
            ans[0] += 1
        elif age <= 19:
            ans[1] += 1
        elif age <= 29:
            ans[2] += 1
        elif age <= 39:
            ans[3] += 1
        elif age <= 49:
            ans[4] += 1
        elif age <= 59:
            ans[5] += 1
        else:
            ans[6] += 1
    for c in ans:
        print c

Submission status: Time Limit Exceeded

Solution code:
while True:
	n = input()
	if n == 0 : break
	
	age = [0, 0, 0, 0, 0, 0, 0,]
	for _ in xrange(n):
		old = input()
		if old < 10 : age[0] += 1
		if 10 <= old and old < 20 : age[1] += 1
		if 20 <= old and old < 30 : age[2] += 1
		if 30 <= old and old < 40 : age[3] += 1
		if 40 <= old and old < 50 : age[4] += 1
		if 50 <= old and old < 60 : age[5] += 1
		if 60 <= old : age[6] += 1
		
	for var in age:
		print var

Submission status: Time Limit Exceeded

Solution code:
while True:
    n=input()
    if n==0:break
    L=[0]*7
    for i in range(n):
        a=input()
        if a<60:
            L[a/10]+=1
        else:
            L[6]+=1
    for i in range(7):
        print L[i]

Submission status: Time Limit Exceeded

Solution code:
while True:
    n=input()
    if n==0:break
    L=[0]*7
    for i in xrange(n):
        a=input()
        if a<60:
            L[a/10]+=1
        else:
            L[6]+=1
    for i in range(7):
        print L[i]

Submission status: Time Limit Exceeded

Solution code:
while True:
    n=input()
    if n==0:break
    L=[0]*7
    for i in range(n):
        a=input()
        if a>60:a=60
        L[a/10]+=1
    for i in range(7):
        print L[i]

Submission status: Time Limit Exceeded

Solution code:
while True:
    n=input()
    if n==0:break
    L=[0]*120
    for i in range(n):
        a=input()
        L[a]+=1
    for i in range(0,51,10):
        print sum(L[i:i+10])
    print sum(L[60:])

Submission status: Time Limit Exceeded

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in range(13)]
    for i in range(n):
        s[input()/10] += 1
    for i in range(6):
        print s[i]
    print sum(s[6:])

Submission status: Time Limit Exceeded

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in range(7)]
    for i in range(n):
        age = input()
        s[age/10 if age<60 else 6] += 1
    for i in range(7):
        print s[i]

Submission status: Time Limit Exceeded

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in range(7)]
    for i in range(n):
        age = input()
        s[min(6, age/10)] += 1
    for i in range(7):
        print s[i]

Submission status: Time Limit Exceeded

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in xrange(7)]
    for i in range(n):
        age = input()
        s[min(6, age/10)] += 1
    for i in xrange(7):
        print s[i]

Submission status: Time Limit Exceeded

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in xrange(7)]
    for i in xrange(n):
        age = input()
        s[min(6, age/10)] += 1
    for i in xrange(7):
        print s[i]

Submission status: Time Limit Exceeded

Solution code:
while 1:
    s = [0 for i in xrange(7)]
    n = input()
    if n==0: break
    for i in xrange(n):
        age = input()
        s[min(6, age/10)] += 1
    for i in xrange(7):
        print s[i]

Submission status: Time Limit Exceeded

Solution code:
from bisect import bisect
D = range(10,61,10)
while True:
    n = input()
    if n == 0:
        break
    A = [0]*7
    for _ in xrange(n):
        A[bisect(D,input())] += 1
    print "\n".join(map(str,A))

Submission status: Time Limit Exceeded

Solution code:
while True:
    n = input()
    if n == 0:
        break
    A = [0]*7
    for _ in xrange(n):
        A[min(input()/10,6)] += 1
    print "\n".join(map(str,A))

Submission status: Time Limit Exceeded

Solution code:
while 1:
	n=input()
	if n==0:break
	h=[0 for i in range(7)]
	for i in range(n):
		h[min(6,input()/10)]+=1
	for i in h:print i

Submission status: Time Limit Exceeded

Solution code:
while True:
    c = [0] * 7
    n = input()
    if not n:
        break
    for i in range(n):
        c[min(input() // 10, 6)] += 1
    for i in c:
        print(i)

Submission status: Time Limit Exceeded

Solution code:
while True:
    c = [0] * 7
    n = input()
    if not n:
        break
    i = 0
    while i < n:
        c[min(input() // 10, 6)] += 1
        i += 1
    for i in c:
        print(i)

Submission status: Accepted

Solution code:
while True:
  x=[0 for i in range(7)]
  n=int(input())
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if 0<=a<10:
      x[0]+=1
    elif 10<=a<20:
      x[1]+=1
    elif 20<=a<30:
      x[2]+=1
    elif 30<=a<40:
      x[3]+=1
    elif 40<=a<50:
      x[4]+=1 
    elif 50<=a<60:
      x[5]+=1
    else:
      x[6]+=1
  for i in range(7):
    print(x[i])

Submission status: Accepted

Solution code:
while 1:
    n = int(raw_input())
    if not n: break
    c = [0 for i in xrange(7)]
    for i in xrange(n):
        age = int(raw_input())
        if age < 10: c[0] += 1
        elif 10 <= age < 20: c[1] += 1
        elif 20 <= age < 30: c[2] += 1
        elif 30 <= age < 40: c[3] += 1
        elif 40 <= age < 50: c[4] += 1
        elif 50 <= age < 60: c[5] += 1
        else: c[6] += 1
    for i in xrange(len(c)):
        print c[i]

Submission status: Accepted

Solution code:
while True:
    n = int(raw_input())
    if n == 0: break
    ans = [0]*7
    for i in xrange(n):
        age = int(raw_input())
        if age <= 9:
            ans[0] += 1
        elif age <= 19:
            ans[1] += 1
        elif age <= 29:
            ans[2] += 1
        elif age <= 39:
            ans[3] += 1
        elif age <= 49:
            ans[4] += 1
        elif age <= 59:
            ans[5] += 1
        else:
            ans[6] += 1
    for c in ans:
        print c

Submission status: Accepted

Solution code:
while True:
    n = int(raw_input())
    if n == 0: break
    ans = [0 for i in range(7)]
    for i in xrange(n):
        age = int(raw_input())
        if age <= 9:
            ans[0] += 1
        elif age <= 19:
            ans[1] += 1
        elif age <= 29:
            ans[2] += 1
        elif age <= 39:
            ans[3] += 1
        elif age <= 49:
            ans[4] += 1
        elif age <= 59:
            ans[5] += 1
        else:
            ans[6] += 1
    for c in ans:
        print c

Submission status: Accepted

Solution code:
while True:
	n = int(input())
	if n == 0: break
	ans = [0 for _ in range(7)]
	for _ in range(n):
		age = int(input())
		if age < 10:
			ans[0] += 1
		elif age < 20:
			ans[1] += 1
		elif age < 30:
			ans[2] += 1
		elif age < 40:
			ans[3] += 1
		elif age < 50:
			ans[4] += 1
		elif age < 60:
			ans[5] += 1
		else:
			ans[6] += 1
	for a in ans:
		print(a)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    To_lis = [0,0,0,0,0,0,0]
    for i in range(n):
        tosi = int(input())
        if tosi < 10:
            To_lis[0] += 1
        elif tosi < 20:
            To_lis[1] += 1
        elif tosi < 30:
            To_lis[2] += 1
        elif tosi < 40:
            To_lis[3] += 1
        elif tosi < 50:
            To_lis[4] += 1
        elif tosi < 60:
            To_lis[5] += 1
        else:
            To_lis[6] += 1
    for k in range(len(To_lis)):
        print(To_lis[k])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
'import math'
while 1:
    n=int(input())
    if n==0: sys.exit()
    arr=[0]*7
    while n:
        a=int(input())
        if a>60: a=61
        arr[int(a/10)]+=1
        n-=1
    for i in range(len(arr)):
        print(arr[i])

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if n==0:break
    arr=[0]*7
    for _ in range(n):
        a=int(input())
        if a>60: a=61
        arr[a//10]+=1
    for i in arr:print(i)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if not n:
        break
    d = {k:[] for k, v in enumerate(range(7))}
    for _ in range(n):
        age = int(input())
        if age >= 10 and age < 20:
            d[1].append(1)
        elif age >= 20 and age < 30:
            d[2].append(1)
        elif age >= 30 and age < 40:
            d[3].append(1)
        elif age >= 40 and age < 50:
            d[4].append(1)
        elif age >= 50 and age < 60:
            d[5].append(1)
        elif age >= 60:
            d[6].append(1)
        else:
            d[0].append(1)
    for k, v in d.items():
        print(sum(v))

Submission status: Accepted

Solution code:
def cls(i):
    if i < 60:
        return i // 10
    else:
        return 6

def answer(n,d):
    tbl = [ 0 for i in range(7) ]
    for i in range(n):
        c = cls(d[i])
        tbl[c] += 1
    return tbl

while True:
    n = int(input())
    if n == 0:
        break
    d = [int(input()) for i in range(n)]
    o = answer(n,d)
    for i in range(7):
        print(o[i])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0184

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        visitors = defaultdict(int)

        for _ in range(n):
            age = int(input())
            if age < 10:
                visitors['under10'] += 1
            elif age < 20:
                visitors['10s'] += 1
            elif age < 30:
                visitors['20s'] += 1
            elif age < 40:
                visitors['30s'] += 1
            elif age < 50:
                visitors['40s'] += 1
            elif age < 60:
                visitors['50s'] += 1
            else:
                visitors['60s+'] += 1

        print(visitors['under10'])
        print(visitors['10s'])
        print(visitors['20s'])
        print(visitors['30s'])
        print(visitors['40s'])
        print(visitors['50s'])
        print(visitors['60s+'])


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0184

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        visitors = defaultdict(int)

        for _ in range(n):
            age = int(input())
            if age < 10:
                visitors['under10'] += 1
            elif age < 20:
                visitors['10s'] += 1
            elif age < 30:
                visitors['20s'] += 1
            elif age < 40:
                visitors['30s'] += 1
            elif age < 50:
                visitors['40s'] += 1
            elif age < 60:
                visitors['50s'] += 1
            else:
                visitors['60s+'] += 1

        print(visitors['under10'])
        print(visitors['10s'])
        print(visitors['20s'])
        print(visitors['30s'])
        print(visitors['40s'])
        print(visitors['50s'])
        print(visitors['60s+'])



def main2(args):
    while True:
        n = int(input())
        if n == 0:
            break
        age = [0] * (120 + 1)

        for _ in range(n):
            n = int(input())
            age[n] += 1

        print(sum(age[0:10]))
        print(sum(age[10:20]))
        print(sum(age[20:30]))
        print(sum(age[30:40]))
        print(sum(age[40:50]))
        print(sum(age[50:60]))
        print(sum(age[60:]))


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0184

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        visitors = defaultdict(int)

        for _ in range(n):
            age = int(input())
            if age < 10:
                visitors['under10'] += 1
            elif age < 20:
                visitors['10s'] += 1
            elif age < 30:
                visitors['20s'] += 1
            elif age < 40:
                visitors['30s'] += 1
            elif age < 50:
                visitors['40s'] += 1
            elif age < 60:
                visitors['50s'] += 1
            else:
                visitors['60s+'] += 1

        print(visitors['under10'])
        print(visitors['10s'])
        print(visitors['20s'])
        print(visitors['30s'])
        print(visitors['40s'])
        print(visitors['50s'])
        print(visitors['60s+'])



def main2(args):
    while True:
        n = int(input())
        if n == 0:
            break
        age = [0] * (12+1)

        for _ in range(n):
            n = int(input())
            age[n//10] += 1

        print(age[0])
        print(age[1])
        print(age[2])
        print(age[3])
        print(age[4])
        print(age[5])
        print(sum(age[6:]))


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

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for _ in range(n)]
    for i in range(0, 60, 10):
        print(len(list(filter(lambda x: i <= x < i+10, a))))
    print(len(list(filter(lambda x: 60 <= x <=120, a))))

Submission status: Accepted

Solution code:
from collections import Counter

while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for _ in range(n)]
    cnt = Counter(i for i in range(7))
    for v in a:
        if v < 10:
            cnt[0] += 1
        elif v < 20:
            cnt[1] += 1
        elif v < 30:
            cnt[2] += 1
        elif v < 40:
            cnt[3] += 1
        elif v < 50:
            cnt[4] += 1
        elif v < 60:
            cnt[5] += 1
        else:
            cnt[6] += 1
    for i in range(7):
        print(cnt[i]-1)

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    ans,ans1,ans2,ans3,ans4,ans5,ans6=0,0,0,0,0,0,0
    if n==0:
        break
    for i in range(n):
        a=int(input())
        a=a//10
        if a==0:
            ans+=1
        if a==1:
            ans1+=1
        if a==2:
            ans2+=1
        if a==3:
            ans3+=1
        if a==4:
            ans4+=1
        if a==5:
            ans5+=1
        if a>=6:
            ans6+=1
    print(ans)
    print(ans1)
    print(ans2)
    print(ans3)
    print(ans4)
    print(ans5)
    print(ans6)

Submission status: Accepted

Solution code:
judge = [10, 20, 30, 40, 50, 60, 121]

while True:

    input_count = int(input())

    if input_count == 0:
        break

    data = [int(input()) for _ in range(input_count)]
    counter = [0] * 7

    for item in data:

        for index, j in enumerate(judge):
            if item < j:
                counter[index] += 1
                break

    counter = [str(item) for item in counter]
    print("\n".join(counter))

Submission status: Accepted

Solution code:
while True:

    input_count = int(input())

    if input_count == 0:
        break

    data = [int(input()) for _ in range(input_count)]

    counter = [0] * 12

    for item in data:
        counter[item // 10] += 1

    counter[6] = sum(counter[6:])
    counter = counter[:7]

    counter = [str(item) for item in counter]
    print("\n".join(counter))

Submission status: Accepted

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

    ans = [0,0,0,0,0,0,0]
    for l in range(n):
        a = int(input())
        a = a // 10
        if a > 6:
            a = 6
        ans[a] += 1

    for i in range(7):
        print(ans[i])

Submission status: Accepted

Solution code:
# AOJ 0184 Tsuruga Castle
# Python3 2018.6.19 bal4u

while True:
	n = int(input())
	if n == 0: break
	f = [0]*14
	for i in range(n): f[int(input())//10] += 1
	f[6] = sum(f[6:14])
	print(*f[0:7], sep='\n')

Submission status: Accepted

Solution code:
# AOJ 0184 Tsuruga Castle
# Python3 2018.6.19 bal4u

while True:
	n = int(input())
	if n == 0: break
	f = [0]*7
	for i in range(n):
		a = int(input())
		if a >= 60: f[6] += 1
		else: f[a//10] += 1
	print(*f, sep='\n')

Submission status: Accepted

Solution code:
def add_dic(x, dic):
  y = x // 10
  if y < 6:
    dic[y] += 1
  else:
    dic[6] += 1

def main():
  while True:
    n = int(input())
    if n == 0:
      break
    dic = [0] * 7
    for _ in range(n):
      add_dic(int(input()), dic)
    print(*dic, sep="\n")

main()

Submission status: Accepted

Solution code:
while 1:
    s = [0 for i in xrange(7)]
    n = input()
    if n==0: break
    for i in xrange(n):
        age = int(raw_input())
        s[min(6, age/10)] += 1
    for i in xrange(7):
        print s[i]

Submission status: Accepted

Solution code:
while 1:
    n = input()
    if n==0: break
    s = [0 for i in range(13)]
    for i in range(n):
        s[int(raw_input())/10] += 1
    for i in range(6):
        print s[i]
    print sum(s[6:])

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == 0:
        break
    A = [0]*7
    for _ in xrange(n):
        A[min(int(raw_input())/10,6)] += 1
    print "\n".join(map(str,A))

Submission status: Accepted

Solution code:
while True:
	n = int(raw_input())
	if n == 0:break
	h = [0 for i in range(7)]
	for i in range(n):
		h[min(6,int(raw_input())/10)] += 1
	for i in h: print i

Submission status: Accepted

Solution code:
while 1:
	n=int(raw_input())
	if n==0:break
	h=[0 for i in range(7)]
	for i in range(n):
		h[min(6,int(raw_input())/10)] += 1
	for i in h:print i

Submission status: Accepted

Solution code:
#無限ループ.0が来たら終わる
while True:
    num = int(input())
    if num == 0:break
    else:
        #カウントするためのリストを作成し、対応する数値を増やす
        num_list = [0 for a in range(7)]
        for _ in range(num):
            i = int(input())
            if i < 10:num_list[0] += 1
            elif i < 20:num_list[1] += 1
            elif i < 30:num_list[2] += 1
            elif i < 40:num_list[3] += 1
            elif i < 50:num_list[4] += 1
            elif i < 60:num_list[5] += 1
            else:num_list[6] += 1
            
        #リストの要素を順番に出力する
        for j in range(0,7):
            print(num_list[j])

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    if n == 0:
        break
    h = [0, 0, 0, 0, 0, 0, 0 ]
    for _ in range(n):
        a = int(input())//10
        if a > 6:
            a = 6
        h[a] += 1
    for i in range(7):
        print(h[i], sep='\n')

Submission status: Accepted

Solution code:
while True:
    num = int(input())
    if num == 0:
        break
    L = [0] * 7
    for _ in range(num):
        L[min(6,int(input())//10)] += 1
    
    print("\n".join(map(str,L)))

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:
        break
    d0=0
    d1=0
    d2=0
    d3=0
    d4=0
    d5=0
    d6=0
    for i in range(n):
        x=int(input())
        if x<10:
            d0+=1
        elif x<20:
            d1+=1
        elif x<30:
            d2+=1
        elif x<40:
            d3+=1
        elif x<50:
            d4+=1
        elif x<60:
            d5+=1
        else:
            d6+=1
    print(d0)
    print(d1)
    print(d2)
    print(d3)
    print(d4)
    print(d5)
    print(d6)

Submission status: Accepted

Solution code:
while True:
  n =int(input())
  if n==0:
    break
  a0=a1=a2=a3=a4=a5=a6=0
  for i in range(n):
    a=int(input())
    if a<10:
      a0+=1
    elif a<20:
      a1+=1
    elif a<30:
      a2+=1
    elif a<40:
      a3+=1
    elif a<50:
      a4+=1
    elif a<60:
      a5+=1
    else:
      a6+=1
  print(a0)
  print(a1)                        
  print(a2)
  print(a3)
  print(a4)
  print(a5)
  print(a6)

Submission status: Accepted

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

    visitor = [0] * 7
    for _ in range(n):
        a = int(input())
        category = a // 10
        if category > 6:
            category = 6
        visitor[category] += 1

    for v in visitor:
        print(v)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break
    age = [0] * 7
    for _ in range(n):
        x = int(input())
        if x < 10:
            age[0] += 1
        elif 10 <= x < 20:
            age[1] += 1
        elif 20 <= x < 30:
            age[2] += 1
        elif 30 <= x < 40:
            age[3] += 1
        elif 40 <= x < 50:
            age[4] += 1
        elif 50 <= x < 60:
            age[5] += 1
        elif 60 <= x:
            age[6] += 1
    print('\n'.join(map(str, age)))

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if not n:break
    a=[0]*7
    for i in range(n):
        a[min(int(input())//10,6)]+=1
    for i in a:
        print(i)

Submission status: Runtime Error

Solution code:
n=int(input())
while True:
  if n==0:
    break
  x=[0 for i in range(7)]
  for i in range(n):
    a=int(input())
    if 0<=a<10:
      x[0]+=1
    elif 10<=a<20:
      x[1]+=1
    elif 20<=a<30:
      x[2]+=1
    elif 30<=a<40:
      x[3]+=1
    elif 40<=a<50:
      x[4]+=1 
    elif 50<=a<60:
      x[5]+=1
    else:
      x[6]+=1
  for i in range(7):
    if x[i]==0:
      print(0)
    else:
      print('{}'.format(x[i]))

Submission status: Runtime Error

Solution code:
n=int(input())
x=[0 for i in range(7)]
while True:
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if 0<=a<10:
      x[0]+=1
    elif 10<=a<20:
      x[1]+=1
    elif 20<=a<30:
      x[2]+=1
    elif 30<=a<40:
      x[3]+=1
    elif 40<=a<50:
      x[4]+=1 
    elif 50<=a<60:
      x[5]+=1
    else:
      x[6]+=1
  for i in range(7):
    if x[i]==0:
      print(0)
    else:
      print('{}'.format(x[i]))

Submission status: Runtime Error

Solution code:
n=int(input())
x=[0 for i in range(7)]
while True:
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if 0<=a<10:
      x[0]+=1
    elif 10<=a<20:
      x[1]+=1
    elif 20<=a<30:
      x[2]+=1
    elif 30<=a<40:
      x[3]+=1
    elif 40<=a<50:
      x[4]+=1 
    elif 50<=a<60:
      x[5]+=1
    else:
      x[6]+=1
  for i in range(7):
    if x[i]==0:
      print(0)
    else:
      print(x[i])

Submission status: Runtime Error

Solution code:
while True:
	n = int(input())
	ans = [0 for _ in range(7)]
	for _ in range(n):
		age = int(input())
		if age < 10:
			ans[0] += 1
		elif age < 20:
			ans[1] += 1
		elif age < 30:
			ans[2] += 1
		elif age < 40:
			ans[3] += 1
		elif age < 50:
			ans[4] += 1
		elif age < 60:
			ans[5] += 1
		else:
			ans[6] += 1
	for a in ans:
		print(a)

Submission status: Runtime Error

Solution code:
#include<algorithm>
#include<iostream>
using namespace std;

int main()
{
  while(1)
  {
    int c[7] = {}, n;
    cin >> n;
    if(!n)
      break;
    for(int i = 0; i < n; i++)
    {
      int a;
      cin >> a;
      c[min(a / 10, 6)]++;
    }
    for(int i = 0; i < 7; i++)
      cout << c[i] << endl;
  }
}