#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXWORD 100
/*Author Stat: founded 2017 11 26*/
static int count_line = 1;
struct line{
int line;
struct line *next;
};
struct tnode{
char *word;
struct line *start;
struct tnode *next;
};
struct tnode *addItem(struct tnode *,char *);
struct line *addlines(struct line *);
void showItem(struct tnode *);
void showLine(struct line *);
struct tnode *Ialloc(void);
struct line *Lalloc(void);
char *walloc(char *);
int getword(char *,int);
int Nonrealword(char *);
int main(void)
{
struct tnode *head;
char word[MAXWORD];
head = NULL;
while(getword(word,MAXWORD) != EOF)
if(Nonrealword(word))
if(isalpha(word[0]))
head = addItem(head,word);
&n
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXWORD 100
/*Author Stat: founded 2017 11 26*/
static int count_line = 1;
struct line{
int line;
struct line *next;
};
struct tnode{
char *word;
struct line *start;
struct tnode *next;
};
struct tnode *addItem(struct tnode *,char *);
struct line *addlines(struct line *);
void showItem(struct tnode *);
void showLine(struct line *);
struct tnode *Ialloc(void);
struct line *Lalloc(void);
char *walloc(char *);
int getword(char *,int);
int Nonrealword(char *);
int main(void)
{
struct tnode *head;
char word[MAXWORD];
head = NULL;
while(getword(word,MAXWORD) != EOF)
if(Nonrealword(word))
if(isalpha(word[0]))
head = addItem(head,word);
&n

本文档将指导你如何编写一个C语言程序,该程序能够遍历文本,列出所有单词及其出现的行号,同时忽略如'the'、'and'等常见非实义词汇。
最低0.47元/天 解锁文章
887

被折叠的 条评论
为什么被折叠?



