xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

從那三個txt文檔讀出數據,然后根據自己寫的算法,從正向和反向推理來的識別用戶所描述是什么動物。

資源截圖

代碼片段和文件信息

#include
#include
#include
#include

#define?MAXNUM?50
typedef?struct
{
int?xuh;
char?valu[50];
}Node;
typedef?struct
{
int?stat;//0:還未訪問???1:至少用過一次???2:沒用過但不沖突
int?xuh;
}NFact;
typedef?struct
{
int?snum;//開始時的事實數
int?curnum;//目前的事實數
int?notEnoughFlag;//當最后若所有未用過的條件支持一個結論,但條件不足時,置1
NFact?cod[MAXNUM];
}Fact;
typedef?struct
{
int?rslt;
int?codNum;//記載前提的個數
int?cod[10];//記載前提的序號
int?used;//記載是否已匹配成功
}Nrule;
typedef?struct
{
int?codXuh;
int?stat;
double?weight;
int?rslt;
//int?codNum;
}bQueueNode;
typedef?struct
{
int?head;
int?tail;
bQueueNode?bNode[MAXNUM];
}bQueue;
typedef?struct
{
int?canReachTime;
int?havReached;
}Reach;
typedef?struct
{
int?lastCodXuhInQueue;
int?myXuh;
//int?mycodNum;
int?myRslt;
double myweight;
}CloseNode;
typedef?struct
{
int?head;
int?tail;
CloseNode?node[MAXNUM];?
}Close;

int?codnum=28;
int?goalnum=7;
int?rulenum=0;
Node?goal[20];
Node?cod[50];
Nrule?rule[50];
Fact?inpCod;
bQueue?bqueue;
Reach?recReach[MAXNUM];
Close?close;
void?readGoal()
{
FILE??*fp;
int?i;
if((fp=fopen(“goal.txt““r“))==NULL)
{
printf(“cannot?open?goal\n“);
exit(0);
}
i=0;
while((fscanf(fp“%d?%s“&goal[i].xuh&goal[i++].valu))!=EOF);
fclose(fp);
}//readGoal
void?readRule()
{
FILE??*fp;
int?i;
int?tempxuhtempcodn;
char?ch;
if((fp=fopen(“rules.txt““r“))==NULL)
{
printf(“cannot?open?data\n“);
exit(0);
}
i=0;
rule[i].codNum=0;

while((ch=fgetc(fp))!=EOF)
{
if(i==14)
i=i;
tempcodn=0;
while(ch!=‘\n‘&&ch!=EOF) //每一條規則
{
tempxuh=0;
while(ch<=‘9‘&&ch>=‘0‘)
{
tempxuh=tempxuh*10+ch-‘0‘;
ch=fgetc(fp);
}
rule[i].cod[tempcodn++]=tempxuh;

tempxuh=0;
if(ch==‘-‘)//下一個是結論
{
ch=fgetc(fp);
ch=fgetc(fp);
while(ch<=‘9‘&&ch>=‘0‘)
{
tempxuh=tempxuh*10+ch-‘0‘;
ch=fgetc(fp);
}
rule[i].rslt=tempxuh;
}//if
else?if(ch==‘*‘)
{
ch=fgetc(fp);
}
rule[i].codNum++;
}


i++;
}

rulenum=i;
fclose(fp);
}//readCod
void?readCod()
{
FILE??*fp;
int?i;
if((fp=fopen(“data.txt““r“))==NULL)
{
printf(“cannot?open?data\n“);
exit(0);
}
i=0;
while((fscanf(fp“%d?%s“&cod[i].xuh&cod[i++].valu))!=EOF);
fclose(fp);
}//readCod
void?readFiles()
{
//char?fname[100];

readGoal();
readCod();
readRule();
}//reaFiles
int?inputCod()
{
int?retflag=1;
int?temp;
int?i;
i=0;
do
{
scanf(“%d“&temp);
inpCod.cod[i++].xuh=temp;
if(temp>=codnum)
{
printf(“特征序號不能大于%d請重新輸入:\n“codnum-1);
fflush(stdin);
retflag=0;
}
}while(temp!=-1&&temp inpCod.snum=i-1;
inpCod.curnum=inpCod.snum;

/*inpCod.snum=5;
inpCod.curnum=inpCod.snum;
inpCod.cod[0].xuh=1;
inpCod.cod[1].xuh=5;
inpCod.cod[2].xuh=10;
inpCod.cod[3].xuh=15;
inpCod.cod[4].xuh=16;*/
return?retflag;
}//inputCod()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????292??2009-12-17?18:16??產生式系統?正向和反向\data.txt

?????文件?????????58??2009-12-13?21:24??產生式系統?正向和反向\goal.txt

?????文件????????179??2009-12-17?18:16??產生式系統?正向和反向\rules.txt

?????文件??????14355??2009-12-26?00:11??產生式系統?正向和反向\產生式系統?正向和反向?finnal.c

?????目錄??????????0??2010-01-09?16:14??產生式系統?正向和反向

-----------?---------??----------?-----??----

????????????????14884????????????????????5


評論

共有 條評論