资源简介
词典变位词检索系统.rar】C实现的、就是每学期期末都会有的课程设计……

代码片段和文件信息
#include
#include
#include
typedef char ElemType;
typedef struct Diction
{
ElemType word[100];
struct Diction *next;
}Diction;
int m;//记录字符串长度
int n;//记录字符串中的字符种类数
char map[256];//记录是哪几种字符
char A[256];
int count[256];//记录每种字符有多少个
void Make_Map(char *str)//统计字符串的相关信息
{
int s[256];
int i;
memset(s0sizeof(s));
memset(count0sizeof(count));
m=strlen(str);
while(*str)
{
s[*str]++;
str++;
}
n=0;
for(i=0;i<256;i++)
if(s[i])
{
map[n]=i;
count[n]=s[i];
n++;
}
}
int stack[1000];
Diction *Find(int depthDiction *headDiction *HEAD)
{
Diction *p*p1*p2;
p=head;
if(depth==m)
{
int i;
for(i=0;i A[i]=map[stack[i]];
A[i]=‘\0‘;
printf(“%s“A);
while(p!=NULL)
{
if(strcmp(p->wordA)==0)
break;
p=p->next;
}
if(p!=NULL)
{
p1=HEAD;
while(p1->next!=NULL)
{
p1=p1->next;
}
p2=(Diction *)malloc(sizeof(Diction));
strcpy(p2->wordA);
p1->next=p2;
p2->next=NULL;
}
putchar(‘ ‘);
}
else
{
int i;
for(i=0;i if(count[i])
{
stack[depth]=i;
count[i]--;
Find(depth+1headHEAD);
count[i]++;
}
}
return HEAD;
}
Diction *read(void)
{
int k;
Diction *head;
Diction *p1*p2;
FILE *fp;
p1=p2=(Diction *)malloc(sizeof(Diction));
k=0;
head=NULL;
if((fp=fopen(“diction.txt““rb“))==NULL)
{
printf(“打不开\n“);
return(head);
}
while(1)
{
if(fread(p1sizeof(Diction)1fp)==1)
{
k=k+1;
if(k==1) head=p1;
else p2->next=p1;
p2=p1;
p1=(Diction *)malloc(sizeof(Diction));
}
else
break;
}
p2->next=NULL;
fclose(fp);
printf(“词典中共%d个单词\n“k);
return(head);
}
void main()
{
int x=0;
Diction *head*q;
printf(“单词变位词查询系统\n“);
head=read();
while(1)
{
Diction *HEAD=(Diction *)malloc(sizeof(Diction));
HEAD->next=NULL;
char str[1000];
printf(“输入单词:“);
gets(str);
Make_Map(str);
printf(“此单词的全排列为:\n“);
HEAD=Find(0headHEAD);
putchar(‘\n‘);
q=HEAD->next;
if(q==NULL)
{
printf(“没有这个单词\n“);
}
else
{
printf(“其中是单词的有:\n“);
while(q!=NULL)
{
printf(“%s\n“q->word);
q=q->next;
}
}
printf(“输入0继续1退出\n“);
scanf(“%d“&x);
getchar();
map[256]=‘1‘;
A[256]=‘1‘;
if(x==1)
break;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2479 2009-01-11 16:18 词典变位词检索系统程序\1.cpp
文件 3341 2009-12-24 13:27 词典变位词检索系统程序\1.dsp
文件 510 2009-12-24 13:27 词典变位词检索系统程序\1.dsw
文件 58368 2009-12-24 13:27 词典变位词检索系统程序\1.ncb
文件 48640 2009-12-24 13:27 词典变位词检索系统程序\1.opt
文件 236 2009-12-24 13:27 词典变位词检索系统程序\1.plg
文件 196723 2009-12-24 08:38 词典变位词检索系统程序\Debug\1.exe
文件 194792 2009-12-24 08:38 词典变位词检索系统程序\Debug\1.ilk
文件 9936 2009-06-29 15:08 词典变位词检索系统程序\Debug\1.obj
文件 220396 2009-06-29 14:57 词典变位词检索系统程序\Debug\1.pch
文件 451584 2009-12-24 08:38 词典变位词检索系统程序\Debug\1.pdb
文件 58368 2009-12-24 13:27 词典变位词检索系统程序\Debug\vc60.idb
文件 53248 2009-06-29 14:57 词典变位词检索系统程序\Debug\vc60.pdb
文件 192634 2009-12-24 13:25 词典变位词检索系统程序\Debug\输入词典.exe
文件 192224 2009-12-24 13:25 词典变位词检索系统程序\Debug\输入词典.ilk
文件 5646 2009-03-27 08:48 词典变位词检索系统程序\Debug\输入词典.obj
文件 220396 2009-03-27 08:48 词典变位词检索系统程序\Debug\输入词典.pch
文件 386048 2009-12-24 13:25 词典变位词检索系统程序\Debug\输入词典.pdb
文件 1352 2009-12-24 13:27 词典变位词检索系统程序\diction.txt
文件 866 2008-12-30 15:04 词典变位词检索系统程序\输入词典.cpp
文件 3427 2009-12-24 13:25 词典变位词检索系统程序\输入词典.dsp
文件 524 2009-12-24 13:27 词典变位词检索系统程序\输入词典.dsw
文件 50176 2009-12-24 13:27 词典变位词检索系统程序\输入词典.ncb
文件 48640 2009-12-24 13:27 词典变位词检索系统程序\输入词典.opt
文件 250 2009-12-24 13:26 词典变位词检索系统程序\输入词典.plg
目录 0 2011-12-18 17:56 词典变位词检索系统程序\Debug
目录 0 2011-12-18 17:56 词典变位词检索系统程序
----------- --------- ---------- ----- ----
2400804 27
............此处省略0个文件信息
- 上一篇:findpass.exe
- 下一篇:电子技能与实训教程教学
相关资源
- 电子词典设计与开发 电子词典123
- 贝贝词典黑莓上最好用的电子词典
- 汉语大词典光盘版
- 含拼音的现代汉语词典
- EXCEL函数手册.chm格式
- 情感词极值表,台湾大学NTUSD简体中文
- 台湾大学NTUSD简体中文情感词典+知网
- NTUSD情感词典+知网HowNet+大连理工DUT
- 全情感词情感词典大全
- 台湾大学NTUSD,知网情感分析用词语集
- 带词性标注的中文分词词典
- 台湾大学NTUSD - 简体中文情感极性词典
- 情感分析-情感词典
- 最新提升版-台湾大学ANTUSD-简体中文情
- 台湾大学情感词典
- 中文基础情感词典(NTUSD/HowNet/Tsingh
- 最全中文情感和语义词库包含好几种
- 维软大词典2005
- 最全中文情感和语义词库
- perl语言:成语词典进行加工,生成一
- 情感和语义分析最全中文数据库
- 四个情感词典汇总.zip
- NTUSD情感字典+清华情感字典+知网情感
- 三个主流情感词典Hownet、NTUSD、清华大
- 中文情感词典
- 台湾大学中文情感极性词典
- 基于深度学习的图像检索系统CNN
- 安卓项目英汉词典
- 朗文当代英语词典ld2格式
- CMU汉语普通话语音识别发音词典含多
评论
共有 条评论