我试图在一段中找到每一个单词的计数,但我无法完成它。
有人能告诉我怎么做吗..。
示例输入
Hi stack over flow is a good forum.There will be many experts in stack overflow .输出--
Hi---1
stack-2
overflow-2
is---1
a---1
good---1
...
...以这种方式,我想得到输出。
这是我的code...but,不是complete...after让我继续前进的
#include<stdio.h>
#include<conio.h>
#include<string.h>
#define NULL 0
struct wordcount
{
char *s;
int count;
struct wordcount next;
}
struct checkletter
{
char alph;
struct wordcount next;
}
main()
{
char *c;
int hash[26],len,i,k=0,intm[100];
struct checkletter complete[26];
for(r=0;r<25;r++)
{
complete[r].alph=r+97;
complete[r].next=NULL;
}
printf("Enter the para :");
gets(s);
len=strlen(s);
for(i=0;i<len;i++)
{
k=0;
if(c[i]==' ')
{
for(j=i;j>m;j--)
{
intm[k]=c[i];
s1=intm;
k++;
}
m=k;
hastlet=s1[0];
for(t=0;t<26;t++)
{
if(complete[t].alph==hastlet)
{
if(complete[t].next==NULL)
complete[t].next=
}发布于 2011-01-31 20:55:05
这是一个草图:
G 211除此之外,如果您有关于您自己实现上述内容的具体问题,请告诉我们,我们可以尝试提供帮助。不过,我们不会为您编写您的代码。
https://stackoverflow.com/questions/4855950
复制相似问题