以下提供不用陣列的python解,若有更好的可以底下再回復
time=int(input())+1one=0two=0three=0i=1while i<time: a=int(input()) b=a%3 if (b==1): one+=1 elif (b==2): two+=1 else: three+=1 i+=1print(str(three)+" "+str(one)+" "+str(two))