#include <stdio.h>
main()
{
int lword = 0, i, c;
int ndigit[100];
for(i = 0;i <100;i++)
{
ndigit[i] = 0;
}
int longest = 0;
while((c = getchar()) != EOF)
{
if(c == ' ' || c == '/n' || c == '/t')
{
ndigit[lword]++;
if(longest < lword)
longest =lword;
lword = 0;
}
else
++lword;
}
for(i = 0; i<100; i++)
{
if(ndigit[i] !=0)
{
printf("%d ",i);
}
}
printf("/n");
for(int j = 0; j<longest;j++)
{
for(i = 0; i<100; i++)
if((ndigit[i]--) >0)
printf("| ");
printf("/n");
}
}
c程序设计系统1-13竖的直方图
最新推荐文章于 2023-10-31 00:47:42 发布