
Private Sub Command1_Click()
Dim x As Integer
x=Val(Text 1.Text)
Select Case
Case Is>=90
Text2.Text=“A”
Case Is>=80
Text2.Text=“B”
Case Is
Text2.Text=“C”
Case Is>=60
Text2. Text=“D”
Case Else
End Select
End Sub
请利用列表实现程序的功能,在划线处将程序补充完整。
mc=(input (“请输入运动会项目名词(1~6):”)) #输入名次,转化为整型
1st=[7,5,4,3,2,1] #定义一个得分列表
if mc>=1 and mc<=6 : #名次在1-6名之间,索引位置
df= #根据索引取列表中相应的成绩
print(“项目得分为:”, )
else:
print(“输入的名次不在[1~6]范围!”)
i=1
sum=0
while i<=20:
if I %2==0:
sum=sum-i
else:
sum=sum+i
i +=1
print (sum)
If a>5 then
if b<4 then
c=a-b
else
c=b-a
End if
Else
if b>3 then
c=a*b
else
c= a mod b
End if
End if
下列程序的功能是:当x<50时,y=0.8×x;当50≤x≤100时,y=0.7×x;当x>100时,输入的数据超出范围。请填空。
Private Sub Command1_Click()
Dim x As Single
x=InputBox("请输入x的值!")
Case x < 50
y=0.8 * x
Case 50 To 100
Print "输入的数据超出范围!"
End Select
Print x, y
End Sub
height=input('你的身高是多少米:')
height=float(height)
weight =input('你的体重是多少KG:')
weight =float(weight)
BMI=weight/(height*height)
if BMI>=24.9:
print('肥胖')
① BMI<24.9 ② BMI>=18.5:
print('正常')
else:
print('偏瘦')
| m= 1 m = m+ 5 n = 5 + m Print n ,m |
| a = 2 b = 3 print a > b |
| a=10 b=20 If a>b then Print a, b Else Print b, a End if |
| For k=15 to 1 step -5 Print k; next |
图1
Private Sub Command1_Click( )
w= val (Text1. text)
if then
f=38
Else
f=
End If
Text2. text=f
End Sub
import math
for num in range(100,1000):
![]()
if num==pow(gw,3)+pow(sw,3)+pow(bw,3): #pow(x,y)函数返回xy的值
print(num)
上述程序段中加框处应该填入的代码段是( )
B .
C .
D .

