#include <stdio.h> main() { int n,a[10]={0}; scanf("%d",&n); while(n>0&&n<=99) { if(n>0 && n<=10) a[(n-1)/10]++; else a[n/10]++; scanf("%d",&n); } for(n=0;n<=9;n++) { if(n==9 && a[9]>0) printf("%d-%d岁%d人\n",n*10,n*10+9,a[n]); if(a[n]>0 && n!=9) printf("%d-%d岁%d人\n",n*10,n*10+10,a[n]);} getchar(); }
标签:11,10,20,21,-%,&& From: https://www.cnblogs.com/xkdn/p/17064677.html