⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhhg.cpp

📁 利用回溯法求解迷宫问题
💻 CPP
字号:
# include <stdio.h>
# include<stdlib.h>
# include<iostream.h>
# include <string.h>
FILE *fp=NULL;
struct WordType
{
	char word[10];
	//int stadr;


};

typedef struct LineNode
{
	WordType keyword;
	int row;
    int count;
	LineList *next;
}*LineP;

typedef struct LinkList
{
	LineP front,rear;
	int size;
	//int count[100];

};


 bool initList(LinkList &L)
 {
	 if(!L.front=L.rear=(LineP)malloc(sizeof(LineNode)));
	 exit(-1);
	 L.front->next=NULL;
	 L.size=0;
 }

 void EnQueue(LinkList &L)
 {
	char s[10];
	cout<<"int put keyword"<<endl;
	cin>>s;
	 LineP p;
	 if(!p=(LineP)malloc(sizeof(LineNode)))
		 exit(-1);
	 p->count=0;
	 p->next=NULL;
	 p->row=0;
    p->keyword=s;
	L.rear->next=p;
	L.rear=p;

 }

 void getKeyWord(LinkList &L)
 {
	 char s[10];
	 cout<<"please input keyword use *** to stop"<<endl;
	 while(s!="***")
	 {
		 EnQueue(L);
	 }
	

 }

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

 bool feoln(FILE *p)
 {
	 char char=fgetc(p);
	 ungetc(cha,p);
	 if(cha=='\n')
		 return true;
	 return false;
 }
void readline()
{
   char buffer[41];
   while (!feof(fp)&&)
   {
	  
    fgets(buffer,40,fp);
     Compare(buffer,LinkList &L);
   }
}


void Compare(char array[],LinkList &L)
{

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -