- ·上一篇:在word中如何输入微秒单位呢
- ·下一篇:word里的背景如何弄成大图,只有一张
统计各分数段人数并显示出来,
2024-07-10 17:49:58
1.统计各分数段人数并显示出来,
main() { int a,b,c,d,e,f,g,h,i,j,k,l,m; a=b=c=d=e=f=g=h=j=k=l; for(i=0;i<20;i++) {printf("input the score:"); scanf("%d",&m); m=m/10; switch(a) {case 10:a++;break; case 9:b++;break; case 8:c++;break; case 7:d++;break; case 6:e++;break; case 5:f++;break; case 4:g++;break; case 3:h++;break; case 2:j++;break; case 1:k++;break; case 0:l++;break; } } printf("100分:%d\n",a); printf("90-99分:%d\n",b); printf("80-89分:%d\n",c); printf("70-79分:%d\n",d); printf("60-69分:%d\n",e); printf("50-59分:%d\n",f); printf("40-49分:%d\n",g); printf("30-39分:%d\n",h); printf("20-29分:%d\n",j); printf("10-19分:%d\n",k); printf("0-9分:%d\n",l); }。