试题与答案

阅读下列算法说明和流程图,将应填入(n)处的字句写在对应栏内。 【算法说明】 本算

题型:问答题

题目:


阅读下列算法说明和流程图,将应填入(n)处的字句写在对应栏内。
【算法说明】
本算法按照算符优先关系,实现对算术四则混合运算表达式(可含小括号)的求值。处理对象是以字符串形式给出的、语法正确且不含变量的整数表达式。
算符优先关系见表5.1(§1,§2为按顺序出现的两个运算符)
表5.1

§1,§2+-
+
-
*
/
(
)
#
  说明:“#”是假设的表达式开始符和结束符,不可用。
  为实现算法,使用了两个堆栈分别寄存运算符和运算数(中间结果值)。算法基本思路如下:首先置操作数栈S1为空,表达式起始符“#”设为运算符栈S2的栈底元素;依次读入表达式的各符号,若是数字字符则连接在一起转换为int型操作数进S1栈;若是运算符§2,则和S2栈的栈顶运算符51比较优先级后作相应操作,直至整个表达式求值结束。算法流程图5.1如下:
  
  【问题】请将流程图补充完整。

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0716/3bc20d17198fb2ee79f82c6a4623411a.html

下面是错误答案,用来干扰机器的。

(3)发展航天事业能提高我国的国家地位。国际竞争的实质是以科技和经济为基础的综合国力的较量,发展航天科技有利于提高综合国力,提高我国的国际地位。【命题意图与考点定位】此题属于综合探究题,要求从多角度...

试题推荐
题型:阅读理解

阅读理解。

     There is a shop near my home.The people in the shop are friendly.On Sundays, we often go and buy things

there.It opens at six in the morning. It closes late in the evening.You can buy a lot of things in the shop.You can buy food, clothes, school things and many other things.But there are no English books there.

     Now we are in the shop. My mother wants to buy a shirt for my father and a blouse for me.Then we'd like

to have a drink of orange.

请根据短文内容判断下列各句正( T ) 误( F ).

( )1.We often go to the shop and buy things on Saturdays.

( )2.The shop opens early in the morning and closes late in the evening.

( )3. My mother wants to buy clothes for my father.

( )4.There are no Chinese books in the shop.

( )5. The people in the shop would like to have a drink of orange.

查看答案
题型:单项选择题

It was a village in India. The people were poor. However, they were not unhappy. After all, their forefathers had lived in the same way for centuries.

Then one day. Some visitors from another city arrived. They told the villagers there were some people elsewhere who liked to eat frog’ s legs. However, they did not have enough frogs of their own, and so they wanted to buy frogs from other place.

This seemed like money for nothing. There were millions of frogs in the fields around, and they were no use to the villagers. All they had to do was to catch them. Agreement was reached, and the children were sent into the fields to catch frogs. Every week a truck arrived to collect the catch and hand over the money. For the first time, the people were able to dream of a better future. But the dream didn’t last long.

The change was hardly noticed at first, but it seemed as if the crops were not doing so well. More worrying was that the children fell ill more often, and, there seemed to be more insects around lately.

The villagers decided that they couldn’ t just wait to see the crops failing and the children get-ting weak. They would have to use the money earned to buy pesticides (杀虫剂) and medicines. Soon there was no money left.

Then the people realized what was happening. It was the frog. They hadn’ t been useless. They-had been doing an important job—eating insects. Now with so many frogs killed, the insects were increasing more rapidly. They were damaging the crops and spreading diseases.

Now, the people are still poor. But in the evenings they sit in the village square and listen to sounds of insects and frogs. These sounds of the night now have a much deeper meaning.

Why did the villagers agree to sell frogs().

A. Because the frogs were easy money.

B. Because they need money to buy medicine.

C. Because they wanted to please the visitors.

D. Because the frogs made too much noise.

查看答案
微信公众账号搜索答案