<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[心灵梦缘]]></title>
<link>http://blog.pfan.cn/wwwzrccom</link>
<description>编程爱好者博客</description>
<language>zh-cn</language>
			<item>
		<title><![CDATA[易中天品三国之真假曹操2B]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31441.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:25:00</pubDate>
		</item>
				<item>
		<title><![CDATA[易中天品三国之真假曹操2C]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31440.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:25:00</pubDate>
		</item>
				<item>
		<title><![CDATA[易中天品三国之真假曹操2A]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31439.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:23:00</pubDate>
		</item>
				<item>
		<title><![CDATA[易中天品三国之大江东去1C]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31438.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:20:00</pubDate>
		</item>
				<item>
		<title><![CDATA[易中天品三国之大江东去1B]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31437.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:19:00</pubDate>
		</item>
				<item>
		<title><![CDATA[易中天品三国之大江东去1A]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/31436.html</link>
		<description><![CDATA[]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-12-15 17:09:00</pubDate>
		</item>
				<item>
		<title><![CDATA[词法分析程序的设计与实现]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/30943.html</link>
		<description><![CDATA[&nbsp;
实验一&nbsp; 词法分析程序的设计与实现
一、实验目的：词法分析程序是编译程序的一个构成成分，它的主要任务是扫描源程序，按构词规则识别单词，并报告发现的词法错误。其中涉及到的主要理论和技术是正则表达式（也叫正规式：regular expression）和有穷自动机（finite automata）。本实验是让学生根据所给的某一较为简单的语言的单词，完成该语言的词法分析程序的设计、编写和调试，并在此过程中掌握相关的理论和方法技术。
二、要求：
（1）&nbsp;&nbsp;&nbsp; 按照下面给出的语言单词，编制一个词法分析程序，该程序应该具有以下功能：
（a）输入字符串（待进行词法分析的源程序），输出为单词串，即由（单词、类别）所组成的二元组序列。
（b）有一定的检查错误的能力。
&nbsp;&nbsp;&nbsp;&nbsp; （2） 提交实验报告。报告内容如下：实验目的、算法描述、程序结构、程序清单、主要变量名说明、调试情况、设计技巧、心得体会。
&nbsp;&nbsp;&nbsp;&nbsp; （3） 上机时间：4~6小时
三、实验环境：PC机，Windows系列版本，任何版本的C语言。
四、词法分析实验题目：设某一语言有如下单词：
关键字:BEGIN , END , IF , THEN ,ELSE
标识符
无符号整常数
运算符: &lt; ,&lt;= , = ,&lt;&gt; ,&gt; , &gt;=
&nbsp;&nbsp;&nbsp; 请编写出识别该语言的词法分析程序。
提示：
&nbsp;&nbsp;&nbsp;&nbsp; 1、实验步骤：
正规文法→NFA → DFA →程序流程图→编写代码
&nbsp;&nbsp;&nbsp;&nbsp; 2、要建立数组，存放输入字符串
3、搜索注意①超前搜索和回退字符②检查错误；
4、注意不同类型的单词的截止标记。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
一个关键字往往以空格和界限符等结束；&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
一个标识符往往以运算符]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-11-16 16:06:00</pubDate>
		</item>
				<item>
		<title><![CDATA[简单词法分析程序]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/30942.html</link>
		<description><![CDATA[#include &lt;iostream&gt;#include &lt;list&gt;#include &lt;iterator&gt;
using namespace std;
int static biaozi=1;class str{public:&nbsp;str(int t,char a[],int len)&nbsp;{&nbsp;&nbsp;for(int i=0;i&lt;len;i++)&nbsp;&nbsp;&nbsp;name[i]=a[i];&nbsp;&nbsp;type=t;&nbsp;&nbsp;leng=len;&nbsp;}&nbsp;void show()&nbsp;{&nbsp;&nbsp;cout&lt;&lt;'('&lt;&lt;type&lt;&lt;',';&nbsp;&nbsp;for(int i=0;i&lt;leng;i++)&nbsp;&nbsp;&nbsp;cout&lt;&lt;name[i];&nbsp;&nbsp;cout&lt;&lt;')';&nbsp;}private:&nbsp;&nbsp;&nbsp;int type;&nbsp;char name[10];&nbsp;int leng;};
void change_input(char a[],int &amp;len)&nbsp;&nbsp; //获取IO_BUFFER中的字符串到a数组{&nbsp;char c;&nbsp;c=getchar();&nbsp;while(c!='#')&nbsp;{&nbsp;&nbsp;a[len++]=c;&nbsp;&nbsp;c=getchar();&nbsp;}&nbsp;a[len++]='#';
}void insert(list&lt;str &gt; &amp;l,int t,char a[],int indexon,int leng)//把每个词法成分放入表中{&nbsp;char temp[20];&nbsp;for(int i=0;i&lt;leng;i++)&nbsp;&nbsp;temp[i]=a[indexon+i];&nbsp;l.push_back(str(t,temp,leng));}void check(list&lt;str&gt; &amp;l,ch]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-11-16 15:58:00</pubDate>
		</item>
				<item>
		<title><![CDATA[迷宫]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27355.html</link>
		<description><![CDATA[头文件
#define D 10struct node1{ int x; int y;};struct node2{ int x; int y; int d;};#ifndef migongtou_H#define migongtou_Hclass M{public:&nbsp;&nbsp;M( int [][10] );&nbsp;void zoulu();&nbsp;void printf();&nbsp;void chenggong();private:&nbsp;node1 fangxiang[8];&nbsp;node2 first[30];&nbsp;int a[D][D];&nbsp;int top;&nbsp;int InX,InY,OutX,OutY,d;};#endifCPP文件
#include&lt;iostream&gt;#include"migongtou.h"using namespace std;M::M( int b[][10] ){&nbsp;for(int i=0;i&lt;D;i++)&nbsp;&nbsp;for(int j=0;j&lt;D;j++)&nbsp;&nbsp;&nbsp;a[i][j]=b[i][j];&nbsp;InX=1;InY=1;OutX=6;OutY=8;&nbsp;top=0;&nbsp;fangxiang[7].x=-1;fangxiang[7].y= 1;&nbsp;fangxiang[0].x= 0;fangxiang[0].y= 1;&nbsp;fangxiang[1].x= 1;fangxiang[1].y= 1;&nbsp;fangxiang[2].x= 1;fangxiang[2].y= 0;&nbsp;fangxiang[3].x= 1;fangxiang[3].y=-1;&nbsp;fangxiang[4].x= 0;fangxiang[4].y=-1;&nbsp;fangxiang[5].x=-1;fangxiang[5].y=-1;&nbsp;fangxiang[6].x=-1;fangxiang[6].y= 0;&nbsp; &nbsp;first[top].x=1;first[top].y=1;first[top].d=-1;&nbsp;top++;&nbsp;fir]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:27:00</pubDate>
		</item>
				<item>
		<title><![CDATA[魔方阵]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27354.html</link>
		<description><![CDATA[#include&lt;iostream&gt;#include&lt;iomanip&gt;using namespace std;#define N 50void mofang(int [][N],int );void printf(const int [][N],int );void main(){&nbsp;int a[N][N]={0};&nbsp;int m;&nbsp;cout&lt;&lt;"请输入行列数(要为奇数):"&lt;&lt;endl;&nbsp;cin&gt;&gt;m;&nbsp;mofang(a,m);&nbsp;printf(a,m);&nbsp;return ;}void mofang( int b[][N],int n){&nbsp;int i,j=n/2;int k=2;&nbsp;b[0][j]=1;i=n-1;j++;&nbsp;while(k&lt;=n*n)&nbsp;{&nbsp;&nbsp;if(b[i][j]==0)&nbsp;&nbsp;{ b[i][j]=k;k++;i--;j++;}&nbsp;&nbsp;else&nbsp;&nbsp;{i+=2;j--;}&nbsp;&nbsp;if(i==-1&amp;&amp;j!=n)&nbsp;&nbsp;&nbsp;i=n-1;&nbsp;&nbsp;if(j==n&amp;&amp;i!=-1)&nbsp;&nbsp;&nbsp;j=0;&nbsp;&nbsp;if(i==-1&amp;&amp;j==n)&nbsp;&nbsp;&nbsp;{i+=2;j--;}&nbsp;}}void printf(const int b[][N],int n){&nbsp;for(int i=0;i&lt;n;i++)&nbsp;{&nbsp;&nbsp;for(int j=0;j&lt;n;j++)&nbsp;&nbsp;&nbsp;cout&lt;&lt;setw(3)&lt;&lt;b[i][j];&nbsp;&nbsp;cout&lt;&lt;endl;&nbsp;}}]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:24:00</pubDate>
		</item>
				<item>
		<title><![CDATA[抽签]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27353.html</link>
		<description><![CDATA[#include&lt;iostream&gt;using namespace std;void chouqian(int [],int [][4],int ,int);void main(){&nbsp;int ren[5]={1,2,3,4,5},haoma[5]={1,2,3,4,5};&nbsp;int M[8][4]={1,0,1,0,0,1,0,0,&nbsp;&nbsp;1,0,0,1,1,0,0,0,&nbsp;&nbsp;0,0,1,0,0,1,0,0,&nbsp;&nbsp;1,0,1,0,0,0,0,1};&nbsp;chouqian(ren,M,8,4);&nbsp;for(int i=0;i&lt;5;i++)&nbsp;&nbsp;cout&lt;&lt;"第 "&lt;&lt;haoma[i]&lt;&lt;" 名"&lt;&lt;"被 "&lt;&lt;ren[i]&lt;&lt;" 号人抽到。"&lt;&lt;endl;&nbsp;return ;}void chouqian(int a[],int b[][4],int m,int n){&nbsp;for(int i=0;i&lt;m;i++)&nbsp;&nbsp;for(int j=0;j&lt;n;j++)&nbsp;&nbsp;&nbsp;if(b[i][j]==1)&nbsp;&nbsp;&nbsp;{int t=a[j];a[j]=a[j+1];a[j+1]=t;}}]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:23:00</pubDate>
		</item>
				<item>
		<title><![CDATA[约瑟夫]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27352.html</link>
		<description><![CDATA[*********.CPP文件*******
#include&lt;iostream&gt;#include"h.h"using namespace std;template&lt;class T&gt;linklist&lt;T&gt;::linklist(T a[],int n){&nbsp;first=new Node&lt;T&gt; ;&nbsp;first-&gt;data=a[n-1];&nbsp;first-&gt;next=first;&nbsp;int i;&nbsp;for( i=0;i&lt;n-1;i++)&nbsp;{&nbsp;&nbsp;Node&lt;T&gt; *s;&nbsp;&nbsp;s=new Node&lt;T&gt;;s-&gt;data=a[i];&nbsp;&nbsp;s-&gt;next=first-&gt;next;&nbsp;&nbsp;first-&gt;next=s;&nbsp;}}template&lt;class T&gt;void linklist&lt;T&gt;::delate(){&nbsp;Node&lt;T&gt; *p,*pre;&nbsp;pre=first,p=first-&gt;next;&nbsp;int count,m;&nbsp;count=2;&nbsp;cin&gt;&gt;m;&nbsp;&nbsp;&nbsp; while(p!=pre)&nbsp;{&nbsp;&nbsp;if (count==m)&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;p-&gt;data&lt;&lt;' ';&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pre-&gt;next=p-&gt;next;delete p;p=pre-&gt;next;&nbsp;&nbsp;&nbsp;count=1;&nbsp;&nbsp;}&nbsp;&nbsp;else p=p-&gt;next,pre=pre-&gt;next,++count;&nbsp;}&nbsp;cout&lt;&lt;p-&gt;data;&nbsp;firs]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:13:00</pubDate>
		</item>
				<item>
		<title><![CDATA[心灵火花--------确定正确的模型]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27351.html</link>
		<description><![CDATA[&nbsp;

在一个房间外有三个开关来控制房间里的三盏灯 
,开关与灯之间是一对一的连接,每个开关恰好控制一 
盏灯,现在开关处于关的位置,在房间外看不见房间内 
的任何东西。问题是需要判断出那个开关控制那盏灯, 
条件是: 你可以任意设置这些开关,然后进入房间,但 
是在你进入房间后,不允许再出来控制这些开关]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:03:00</pubDate>
		</item>
				<item>
		<title><![CDATA[心灵火花--------确定正确的模型]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/27350.html</link>
		<description><![CDATA[&nbsp;

在一个房间外有三个开关来控制房间里的三盏灯 
,开关与灯之间是一对一的连接,每个开关恰好控制一 
盏灯,现在开关处于关的位置,在房间外看不见房间内 
的任何东西。问题是需要判断出那个开关控制那盏灯, 
条件是: 你可以任意设置这些开关,然后进入房间,但 
是在你进入房间后,不允许再出来控制这些开关]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-07-06 21:03:00</pubDate>
		</item>
				<item>
		<title><![CDATA[汉诺塔]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/26294.html</link>
		<description><![CDATA[#include&lt;iostream.h&gt;void hanno(int,char,char,char);int main(){&nbsp;int n;&nbsp;cout&lt;&lt;"请输入你要有多少个盘子:";&nbsp;cin&gt;&gt;n;
&nbsp;hanno(n,'A','B','C');&nbsp;return 0;&nbsp;}void hanno(int n,char A,char B,char C){&nbsp;if(n==1)cout&lt;&lt;A&lt;&lt;"-&gt;"&lt;&lt;C&lt;&lt;endl;&nbsp;else {&nbsp;&nbsp;hanno(n-1,A,C,B);&nbsp;&nbsp;cout&lt;&lt;A&lt;&lt;"-&gt;"&lt;&lt;C&lt;&lt;endl;&nbsp;&nbsp;hanno(n-1,B,A,C);&nbsp;}}]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-31 18:37:00</pubDate>
		</item>
				<item>
		<title><![CDATA[helpsvc.exe处理]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/26235.html</link>
		<description><![CDATA[进程文件：&nbsp;helpsvc&nbsp;或者&nbsp;helpsvc.exe&nbsp;进程名称：&nbsp;Microsoft&nbsp;Helpsvc&nbsp;描述：&nbsp;helpsvc.exe是Windows&nbsp;2000以及更高版本Windows的帮助服务。&nbsp;出品者：&nbsp;Microsoft&nbsp;属于：&nbsp;Microsoft&nbsp;Help&nbsp;Center&nbsp;Service&nbsp;系统进程：&nbsp;否&nbsp;后台程序：&nbsp;是&nbsp;使用网络：&nbsp;否&nbsp;硬件相关：&nbsp;否&nbsp;常见错误：&nbsp;未知N/A&nbsp;内存使用：&nbsp;未知N/A&nbsp;安全等级&nbsp;(0-5):&nbsp;0&nbsp;间谍软件：&nbsp;否&nbsp;广告软件：&nbsp;否&nbsp;病毒：&nbsp;否&nbsp;木马：&nbsp;否&nbsp;
&nbsp;
开始-&gt;运行-&gt;gpedit.msc-&gt;用户配置-&gt;管理模板-&gt;系统-&gt;&nbsp;不要运行指定的Windows应用程序&nbsp;双击它，选启用，再选显示，再选添加，输入helpsvc.exe确定，应用，再确定]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-28 22:53:00</pubDate>
		</item>
				<item>
		<title><![CDATA[将一个非负的十进制的整数转换成另一个基为B的B进制的数]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/25979.html</link>
		<description><![CDATA[编写一个完整的程序, 将一个非负的十进制的整数转换成另一个基为B的B进制的数, 其转换的公式如下:&nbsp; N=bjBJ+bj-1BJ-1+….b1B+b0 =( N/B)*B+N%B=( N/B)*B+ b0再令N=(N/B) 做除B求模运算可求出b1, 依次类推求出b2…..bj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提示: 在计算bj时是从低位到高位, 而输出时是从高位到低位, 这正好栈的处理方式, 所以用栈来实现数制间的转换
并假定基B=十六(0,1,2,3…9,A,B,C,D,E,F )]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-18 18:35:00</pubDate>
		</item>
				<item>
		<title><![CDATA[将一个非负的十进制的整数转换成另一个基为B的B进制的数]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/25978.html</link>
		<description><![CDATA[一、 编写一个完整的程序, 将一个非负的十进制的整数转换成另一个基为B的B进制的数, 其转换的公式如下:&nbsp; N=bjBJ+bj-1BJ-1+….b1B+b0 =( N/B)*B+N%B=( N/B)*B+ b0再令N=(N/B) 做除B求模运算可求出b1, 依次类推求出b2…..bj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提示: 在计算bj时是从低位到高位, 而输出时是从高位到低位, 这正好栈的处理方式, 所以用栈来实现数制间的转换
并假定基B=十六(0,1,2,3…9,A,B,C,D,E,F )]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-18 18:35:00</pubDate>
		</item>
				<item>
		<title><![CDATA[将一个非负的十进制的整数转换成另一个基为B的B进制的数]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/25977.html</link>
		<description><![CDATA[一、 编写一个完整的程序, 将一个非负的十进制的整数转换成另一个基为B的B进制的数, 其转换的公式如下:&nbsp; N=bjBJ+bj-1BJ-1+….b1B+b0 =( N/B)*B+N%B=( N/B)*B+ b0再令N=(N/B) 做除B求模运算可求出b1, 依次类推求出b2…..bj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提示: 在计算bj时是从低位到高位, 而输出时是从高位到低位, 这正好栈的处理方式, 所以用栈来实现数制间的转换
并假定基B=十六(0,1,2,3…9,A,B,C,D,E,F )]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-18 18:35:00</pubDate>
		</item>
				<item>
		<title><![CDATA[卡西尼悖论]]></title>
		<link>http://blog.pfan.cn/wwwzrccom/25795.html</link>
		<description><![CDATA[&nbsp;

卡西尼悖论: 有一个8×8的棋盘,按照图a所示,将它切成两个梯形和两个三角形,然后再按图b把它们拼接起来,图a的面积是8×8=64,而图b面积是13 ×5=65,请解释该悖论 ??]]></description>
		<author><![CDATA[wwwzrccom]]></author>
		<pubDate>2007-05-11 12:45:00</pubDate>
		</item>
		</channel>
</rss>