CCF CSP 202104-1灰度直方图(C语言)
作者:互联网
#include<stdio.h>
#include <stdlib.h>
int main(){
int n,m,l,i,x;
scanf("%d %d %d",&n,&m,&l);
int *h;
h=(int *)malloc(sizeof(int)*l);
for(i=0;i<l;i++){
h[i]=0;
}
for(i=0;i<m*n;i++){
scanf("%d",&x);
h[x]+=1;
}
for(i=0;i<l;i++){
printf("%d ",h[i]);
}
}
标签:main,202104,int,scanf,直方图,灰度,include 来源: https://blog.csdn.net/ffffffyr/article/details/119217655