问题 问答题

假设栈Stack的容量是2,栈元素的数据类型是char类型,该栈对象有三种状态,分别为:S1——栈空状态;S2——非空非满状态;S3——栈满状态。转换到各个状态的条件如下。
S1:(c0)创建并初始化栈。
(c1)在S2下执行置空运算Clear()。
(c2)在S2下执行出栈运算Pop()。
(c3)在S3下执行置空运算Clear()。
S2:(c4)在S1下执行进栈运算Push()。
(c5)在S3下执行出栈运算Pop()。
S3:(c6)在S2下执行进栈运算Push()。
要求:
1.根据题设条件,画出栈对象的状态迁移图。

答案

参考答案:测试路径如下:

阅读理解

The expression “down to earth” means being open and honest. It is easy to get on with some one who is down to earth. A down-to-earth person is the opposite of someone who acts important or proud.

Down-to-earth people could be important members of society. But they do not consider themselves to be better than others who are less important. A person who is filed with his own importance and pride is said to have his nose in the air.

Americans use another expression that is similar in some ways to down to earth. The expression is both feet on the ground. Someone with both feet on the ground is a person with a good understanding of reality(现实). He may have dreams, but he does not allow them to have influence on his understanding of what is real.

The opposite kind of person is one who has his head in the clouds. Someone with his head in the clouds is a person whose mind is not on what is happening in real life. Such a person may be called a day-dreamer.

When we have both our feet on the ground, and when we are down to earth, we do not have our noses in the air. We act honestly and openly to others. Our lives are like the ground below us— solid(牢固的) and strong.

小题1:A down-to-earth person could be_____________.

A.social and proud

B.good and opposite

C.real and important

D.strong and changeable小题2:The expression “has one’s nose in the air” means_____________.

A.眉飞色舞

B.目中无人

C.瞻前顾后

D.春风得意小题3:This passage mainly talks about_____________.

A.the use of some expressions

B.dreams and achievements

C.the lifestyle of honest people

D.honesty and understanding小题4:If you want to understand what is real in life, you have to_____________.

A.get along with other people easily

B.learn from those who are down to earth

C.be a good dreamer with quick mind

D.have both your feet on the ground小题5:If you only consider your own importance, __________.

A.you’ll think you are better than others

B.your life will be like the solid and strong ground

C.you’ll be hated by down-to-earth people

D.your life will be filed with love

选择题