#include<cstdio> int main(){ int n,F,Fmax=0,a[100000]={}; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&F); Fmax=F>Fmax?F:Fmax; a[F]++; } for(int i=0;i<=Fmax;i++){ if(i==Fmax)printf("%d",a[i]); else printf("%d\n",a[i]); } return 0; }
好像没啥问题啊