Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 编程的艺术 > C/C++
C/C++ The C++ Programming Language.
回复
 
主题工具 显示模式
旧 2010-07-11, 17:08   #1
wo19860612
初级会员
 
注册日期: 2010-07-11
年龄: 38
帖子: 1
声望力: 0
wo19860612 正向着好的方向发展
难过 关于一个课程设计的 一点头绪没有呢

[问题描述]
有一个魔王总是使用自己的一种非常精练而抽象的语言讲话,没有人能听得懂,但他的语言是可以逐步解释成人能听懂的语言的,因为他的语言是由以下两种形式的规则由人的语言逐步抽象上去的:
(1)α→β1β2...βm
(2)(θδ1δ2...δn)→θδnδn-1...θδ1θ
在这两种形式中,从左到右均表示解释。试写一个魔王语言的解释系统,把他的话解释成人能听得懂的话。

[基本要求]
用下述两条具体规则和上述规则形式(2)实现。设大写字母表示魔王语言的词汇;小写字母表示人的语言词汇;希腊字母表示可以用大写字母或小写字母代换的变量。魔王语言可含人的词汇。
(1)B→tAdA (2)A→sae

[测试数据]
B(ehnxgz)B解释成tsaedsaeezegexenehetsaedsae,若将小写字母与汉字建立下表所示的对应关系测魔王说的话是:“天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅”。
T d s a e z g x n h
天 地 上 一只 鹅 追 赶 下 蛋 恨
表达式计算是实现程序设计语言的基本问题之一,也是栈的应用的一个典型例子。设计一个程序,演示用算符优先法对算术表达式求值的过程。
[实现提示]
将魔王的语言自右至左进栈,总是处理栈顶字符。若是开括号,则逐一出栈,将字母顺序入队列,直至闭括号出栈,并按规则要求逐一出队列再处理后入栈。其他情形较简单,请读者思考应如何处理。应首先实现栈和队列的基本操作

这就是课设的具体内容 希望大家多多提宝贵建议和提示 谢谢 哪位大侠帮写出程序来就更感谢了! 马上就交了 急啊!
wo19860612 当前离线   回复时引用此帖
旧 2012-07-18, 19:21   #2
xuewuleiuu9u
初级会员
 
注册日期: 2012-05-04
年龄: 40
帖子: 1
声望力: 0
xuewuleiuu9u 正向着好的方向发展
默认 回复: 关于一个课程设计的 一点头绪没有呢

Now it is not only young in spirit, but also young in silhouette Sugary Foods & Drinks: Lets face it,new nfl jerseys, sugar tastes great,www.mlbshoppingmall.com, but it WILL make you fat and unhealthy Some are entirely black, some people show team colors and color panelForum MallLocated at the heart of Elgin Road, Forum Mall is Kolkata抯 1st shopping center and the 1st shopping mall in India to incorporate cinemas with shopping
That's the reason artificial Burberry Scarves are renowned manufacturer sunglass because of the flawless types in addition to unquestionable surfaces all across the globe As you fill your hamper remember that you should pack it tightly using more wood wool, so you avoid any movement that can result in damages There are a number of ways to find these retailers and seeking them out online is the fastest way We all know instinctively that somewhere in the mall sleeps a dragon ready to destroy any man who stays too long in the mall
The Canadian political and legal models evolved from the British tradition into a more realistic and humanistic effort to reform criminals rather than ostracize them for life The nation is known for great men who made a history never to be forgotten You can抰 easily find them in stores so you won抰 have to worry about going to a party and seeing five other women toting the same handbag as yoursWine Classification
Similar legislation has been passed in 23 other states since 2005You can buy native works of art like wood sculptures and masks Fortunately, there are data recovery services available that can help you with the overwhelming task of recovering your lost data You can make a fresh salad every day,www.jerseywholesaleronline.com, or put in a few extra minutes and put together an adequate amount to last quite a few days
Related articles:


www.mymlbjersey.com4126beautiful
xuewuleiuu9u 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 02:58


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.