问题 填空题

执行下面的程序,消息框里显示的结果是 【13】 。Private Sub Form Click() Dim Str As String,K As Integer Str="ab" For k=Len(Str) To 1 Step -1 Str=Str & Chr(Asc(Mid(Str,k,1))+k) Next k MsgBox StrEnd Sub

答案

参考答案:abdb

解析: 本题考查VBA程序设计。题目较难,综合性强,要求考生对常用函数以及控制结构有一定的了解。考生应该了解Len()函数是字符串长度检测函数,返回字符串所含字符数。 Chr()函数是字符代码转换字符函数,将数值表达式转换成字符串。Asc()函数是字符串转换字符代码函数,返回字符串首字符的ASCII值。 Mid(<字符串表达式>,<N1>,<N2>)函数是从字符串左边第N1个字符起截取N2个字符。开始Len(StrO=2,Mid(Str,k,1)=Mid(ab,2,1)=b,则Chr(Asc(b)+2)=d,所以循环第1次结束后 Str="abd",同样的第2次循环结束后, Str="abdb",MsgBox用来将Str输出。正确答案为abdb。

填空题


A patrol team of sea lions and dolphins featured in a large-scale military exercises being conducted by the U. S. and its allies in the Pacific Ocean. The machine (1) took part in simulated mine recovery and mine detection missions during the biennial Rim of the Pacific Exercise (RIMPAC) war games. The (2) started on June 19 and will run (3) Friday.
"There are a number of mechanical systems that work in those areas. (4) high-tech gadgets deployed by the military can’t (5) the natural skills of dolphins and lions," said Tom Lapuzza, spokesman for UN Navy’s Marine Mammal Program. Sea lions have "incredible good underwater (6) " and can dive down to 300 meters to catch a recovery line to a mine, he said. Dolphins use sonar to (7) mine.
Human beings have a long (8) of training animals to join the military. Horses have been the most widely-used animals (9) the recorded history of (10) . In early times, horses were used to (11) chariots or to (12) armored forces. With the development of modem weapons and motorized (13) , the use of horses for military purposes fell into (14) . (15) , horses were still used (16) by the German army during World War II for transporting (17) and equipment, including artillery.
During World War II, (18) with explosives strapped to their backs were used as anti-tank weapons. In other (19) , they were used for detecting mines. Some dogs were also used as messengers.
Other animals have also (20) in the military. Recorded history shows the use of elephants for military purposes as early as 1,100 B. C.. They were employed during World War II by both the Japanese army and the (21) .
There are records showing that over 100,000 reindeer were used by Finland to tow sleds during World War II. They carried the (22) to hospitals, brought supplies to the troops and moved heavy anti-tank weapons. It is well documented that oxen have been (23) used in war as improvised beasts of burden. During World War II, spiders were employed by the Allies to spin silk for (24) in cross-hairs on bomb scopes and other optical instruments. People also are finding that Vampire bats’ ability to use echolocation is very interesting as we (25) to learn how it works and it may benefit the army.

问答题 简答题