试题与答案

以下Prime 过程,用于判断一个数是否为素数。素数是只能被1和数本身整除的自然数。

题型:填空题

题目:

以下Prime 过程,用于判断一个数是否为素数。素数是只能被1和数本身整除的自然数。一个自然数不是素数,就是合数。用被测试的数除以从2开始到该数本身的数,如果能除尽(余数为0),则为合数;如果都除不尽(余数均不为0),则为素数。请在划线处将下面过程补充完整:
Function Prime(inputvar As Integer)As Integer
For i=2 To inputvar-1
If inputvar Mod i= 【13】 Then
GoTo comfinish
End If
Next i
Prime=inputvar
Print"素数"
GoTo 【14】
comfinish:
Prime=inputvar
Print"合数"
finish:
End Function

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0602/5ba5c67eaddfd89c06613746f62af565.html

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

参考答案:B解析: 选项A,在关系运算符中,不含有运算符|;选项C,布尔逻辑运算符只有!、&&和||三种,其中的逻辑或运算符||可能会和运算符|混淆,但是应该正确区分,||运算符应该是逻辑或,而|运算符应该是按位...

试题推荐
题型:阅读理解

阅读理解。

     Nothing says love like a dozen long-stemmed roses on Valentine's Day. More than a million roses will

be sold during this festival for lovers, the biggest day of the year for the nation's rose industry. It's going

to remain the most popular flower because love never goes out of style.

     Yes, a rose is a rose. But selling them is no longer a beautiful experience for traditional flower shops.

Supermarkets now offer convenience to the busy and discount rose shops help those hopelessly in love

save money. Roses Only is a good example of a discount rose retailer that was transformed from a

traditional shop to answer the challenge in the 90's.

     Inside this store on Sixth Avenue near 40th Street, contemporary white furniture and wall-to-wall

mirrors give it an expensive look. Customers move about freely among the counters, looking eagerly at the

roses in more than 50 colors from shelf to shelf. Some customers say it's the high quality of the roses that

attracts them there. "I spent $20 but the flowers looked like I paid 60 or 70 dollars," says one customer.

     Studies show more people are buying roses in ones, twos and threes these days. In fact, more than half

of all roses are sold in bunches of fewer than a dozen. But Roses Only's low prices encourage people to

spend. Even on Valentine's Day, when the price of a dozen roses and delivery can soar as high as $150, 12

of Roses Only's most expensive flowers sell for just $35. The company's key to success is to hold prices

down by controlling every link in the rose chain. It grows its own roses in the sunshine of the Andes

Mountains. In addition, the company also sells other items such as balloons and stuffed animals.

     While discount rose retailers are witnessing their business bloom, U.S. rose growers aren't able to

compete with the fierce foreign competition. More than 57% of roses sold in the USA are grown in other

countries. The biggest foreign producers are Colombia and Ecuador, which accounted for almost 90% of

the total imported last year. The trend has hurt domestic rose growers such as Johnson Flowers of California,

considered to be this country's leading producer.

     Now, instead of fighting overseas rivals, the Johnsons are trying to work with them. "We have a few

big fighting overseas rivals, the Johnsons are trying to work with them. We may also widen our business

to include the service area and be a representative for overseas flower producers."

     As a result of severe competition, those in the rose business long for the good old days, whereas ordinary

people benefit from the low price.

1. What is the central theme of this text?

A. The US rose business is going from bad to worse in spite of the efforts made.

B. The rose will remain the most popular flower as love never goes out of date.

C. The rose business is trying to meet the challenges in the market to succeed.

D. The rose industry plays an important role in American economy.

2. How does Roses Only obtain success in the discount rose retailing field?

A. By setting up more chain stores across the country.

B. By selling roses in supermarkets.

C. By selling high quality roses at a low price.

D. By selling roses by the dozen.

3. Which of the following shows the structure of the passage? (① to ⑦represent paragraphs l to 7)

A.  B.  C.  D.

4. After reading the passage,we learn all of the following EXCEPT _____.

A. selling roses is no longer as easy for traditional flower shops as it was

B. almost 90% of roses sold in US are imported from Colombia and Ecuador

C. US rose growers are faced with intense foreign competition

D. the Johnsons are trying to co-operate with foreign competitors instead of fighting them

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