The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
标签: government streamline important alphabet
上传时间: 2015-06-09
上传用户:weixiao99
E:\VISUAL C++MFC扩展编程实例 实例35 添加帮助菜单项,在本例中将向应用程序中的H e l p菜单中添加C o n t e n t s和S e a r c h 菜单项。
上传时间: 2014-01-09
上传用户:541657925
一:需求分析 1. 问题描述 魔王总是使用自己的一种非常精练而抽象的语言讲话,没人能听懂,但他的语言是可逐步解释成人能听懂的语言,因为他的语言是由以下两种形式的规则由人的语言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在这两种形式中,从左到右均表示解释.试写一个魔王语言的解释系统,把 他的话解释成人能听得懂的话. 2. 基本要求: 用下述两条具体规则和上述规则形式(2)实现.设大写字母表示魔王语言的词汇 小写字母表示人的语言的词汇 希腊字母表示可以用大写字母或小写字母代换的变量.魔王语言可含人的词汇. (1) B --> tAdA (2) A --> sae 3. 测试数据: B(ehnxgz)B 解释成 tsaedsaeezegexenehetsaedsae若将小写字母与汉字建立下表所示的对应关系,则魔王说的话是:"天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鹅 | 追 | 赶 | 下 | 蛋 | 恨 |
上传时间: 2014-12-02
上传用户:jkhjkh1982
Thinking in C++ patiently and methodically explores the issues of when and how to use inlines, references, operator overloading, inheritance and dynamic objects, as well as advanced topics such as the proper use of templates, exceptions and multiple inheritance. The entire effort is woven in a fabric that includes Eckel’s own philosophy of object and program design. A must for every C++ developer’s bookshelf, Thinking in C++ is the one C++ book you must have if you’re doing serious development with C++.
标签: methodically and patiently Thinking
上传时间: 2014-01-03
上传用户:it男一枚
【实验名称】递归子程序分析器的设计与实现 【实验目的和要求】 设计、编制,调试一个典型的语法分析程序,实现对如下的递归子程序语法的分析,进一步掌握常用的语法分析方法。 【实验内容】 ① 本分析程序所分析的文法如下: G[E]: E->eBaA A->a|bAcB B->dEd|aC C->e|dC ② 针对上述文法编写一递归子程序分析程序,该程序的输入是任意符号串,输出是本次输入的符号串是否是该文法的句子的结论。 【环境】 Windows Pc 机,任何版本的c语言 其中还包括java语言实现的程序
上传时间: 2013-12-25
上传用户:lanhuaying
simulink s函数,用C写的CRC校验和解校验的程序,原理简单,但是可以用来做学习simulink的好例子。
上传时间: 2016-04-01
上传用户:mhp0114
2. 进入程序后,即会显示提示用户是否需要创建魔王词汇,选择y则用户自己创建魔王词汇,选择n则使用默认的魔王词汇为:默认的魔王词汇(只有A=sae,B=tAdA,C=sce,D=sde)之后会有相关的作者信息。下面就提示用户输入魔王语句,输入完后就会输出翻译后的魔王语句。
标签: 程序
上传时间: 2016-08-17
上传用户:hoperingcong
利用伟福 Lab2000P单片机实验仪上提供的显示电路和键盘电路,做一个简单的计算器。用十六进制A键 =‘+’、B键 =‘-’、C键 = ‘x’、D键 = ‘/’、E键 = ‘=’、F键 = ‘C’。
上传时间: 2016-08-22
上传用户:ukuk
C++实现神经网路的bp算法,初学者可以参考下 BP algorithm of neural network s achievement based on c++, maybe it is useful to a new learner
上传时间: 2016-11-06
上传用户:aa17807091
made by: kangkai data:2008.11.23 this one is used to test arm7 str71x. use a led to test GPIO. a---------P0.0 b---------P0.1 c---------P0.2 d---------P0.3 e---------P0.4 f---------P0.5 g---------P0.6 just run it and you will see the led to show 0-9 all the time.
上传时间: 2016-12-16
上传用户:moerwang