【文学研究社】文学研究助手(改正版)

更新时间:2015-02-23    来源:Yahoo研究    手机版     字体:

【www.bbyears.com--Yahoo研究】

//本程序可以实现基本功能,请大家根据情况填加完善本程序的程序段!
#include "string.h"
#include "stdio.h"
#include "alloc.h"
#include "stdlib.h"
#define N 10       
#define M 10      
struct linelist
{
    int linenum;
    struct linelist *next;
};
struct keyword
{
    struct string *string1;
    int num;
    struct linelist *head,*tail;
}keyword1[N];
 
struct string
{char string2[M];
}string3[N]={’/0’};
FILE *fp=NULL;
int row=0;              
 
void init() 
{
    int i;
    for (i=0;i
    {keyword1[i].num=0;
        keyword1[i].string1=string3[i].string2;
        keyword1[i].head=NULL;
        keyword1[i].tail=NULL;
    }
}
void fileopen()

    char filename[30];
    for (;;)
    {
        printf("请输入要查找关键字的文件:");
        scanf("%s",filename);
        if ((fp=fopen(filename,"r"))==NULL)
            printf("不能打开此文件!请重新输入!n");
        else
            break;
    }
}
 
void inputkeyword()
{
    int i;
    for (i=0;i
    {printf("请输入要查找的关键字:");
        scanf("%s",string3[i].string2);
    }
}

本文来源:http://www.bbyears.com/seo/13164.html

猜你感兴趣

热门标签

更多>>

本类排行