C语言:统计一篇英文文章中所要查询单词出现的次数以及出现的位置

问题描述:

C语言:统计一篇英文文章中所要查询单词出现的次数以及出现的位置
【问题描述】统计一篇英文文章中所要查询单词出现的次数以及出现的位置.
【基本要求】
(1) 要进行统计的英文文章为一个已经存在文件中的内容;
(2) 要查询单词运行时进行输入;
(3) 不区分大小写,如The与the看成一个单词;
【测试数据】举例:
Recently,there has been a discussion regarding the issue of knowledge in the newspaper.As can be seen from the picture,knowledge is symbolized a clenched fist as power,the fist sends out a message for "obedience",threatening to crack with power any hard nut.The more demanding and challenging a task is,the more powerful the fist seems to grow.Similarly,knowledge,the strongest power for human beings,feeds up the field of science and technology.The more advanced and developed a field is,the more profound knowledge seems to become.
该文章中单词the出现的次数为11,第一个 the出现的位置为:48,也既前面出现的字符个数.
求完整的程序,急,
1个回答 分类:综合 2014-09-26

问题解答:

我来补答
文件存在与程序同一目录下,文件名为test.txt
#include
#include
void change(char *a)
{
while(*a!='\0')
{
if(*a>='A'&&*a
 
 
展开全文阅读
剩余:2000