未分类题

阅读下列程序: Private Sub Commad1_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 Print H(k) Next i End Sub Function H(j As Integer) a=0 Static b a=a+1 b=b+1 H=a*b+j End Function 程序运行后,单击命令按钮输出结果是
D.356

A.234
B.345
C.567

【参考答案】

B
解析:在此题中,被调过程是一个函数过程,它有一个形式参数j,在被调过程声明中,定义了一个参数a,初值为o,一个静态变量b。语句a=a+1和b=b+1分别使a和b各增加1,然后返回H的值,因为b是静态变量,所以每次调用同一个参数k时,b会保留前次的数值,使输出结果变化,否则每次输出的结果都...

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
热门 试题

未分类题
Health implies. more than physical fitness. It also implies mental and emotional wellbeing. An angry, frustrated, emotionally (1)_____ person in good physical condition is not (2)_____ healthy. Mental health, therefore, has much to do (3)_____ how a person copes with the world as it exists. Many of the factors that (4)_____ physical health also affect mental and emotional well-being.Having a good self-image means that people have positive (5)_____ pictures and good positive feelings about themselves, about what they are capable (6)_____, and about the roles they play. People with good self-images like themselves, and they are (7)_____ like others. Having a good self- image is based (8)_____ a realistic (9)_____ of one's own worth and value and capabilities.Stress is an unavoidable, necessary, and potentially healthful (10)_____ of our society. People of all ages (11)_____ stress. Children begin to (12)_____ stress during prenatal development and during childbirth. Examples of stress-inducing (13)_____ in the life of a young person are death of a pet, pressure to (14)_____ academically, the divorce of parents, or joining a new youth group. The different ways in which individuals (15)_____ to stress may bring healthful or unhealthy results. One person experiencing a great deal of stress may function exceptionally well (16)_____ another may be unable to function at all. If stressful situations are continually encountered, the individual's physical, social, and mental health are eventually affecteD.Satisfying social relations are vital to (17)_____ mental and emotional health. It is believed that in order to (18)_____, develop, and maintain effective and fulfilling social relationships people must (19)_____ the ability to know and trust each other, understand each other, influence, and help each other. They must also be capable of (20)_____ conflicts in a constructive way.A.unstableB.unsureC.impreciseD.impractical
A.B.
C.
D.
A.unstable
B.unsure
C.imprecise
相关试题