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
#输入x的值,
x=int (input(“请输入一个数x:”))
if x<50:
y=
print(“y的值是:”,y)
elif:
y=0.7*x
print(“y的值是:”,y)
else:
print(“输入数据出界”)
输入一个成绩,判断该成绩属于“优秀”、“良好”、“及格”还是“不及格”。
Private Sub Command1_Click( )
Dim x As Integer
x= (Text1.Text)
Select Case x
Text2.Text=“优秀”
Case x≧75
Case Else
Text2.Text=“不及格”
End Select
End Sub
Private Sub Form_Click( )
Dim a, b, c, s As Integer
a=9
b=41
c=2*(a+b)
s=a*c
Private Sub Form_Click( )
Dim a As Integer, b As Integer
If a>b Then
a=a-b
Else
a=b+a
End if
Print a
Private Sub Form_Click( )
Dim x As Integer, a As Integer
x=0
a=0
For j=1 to 5
a=a+j
Next j
x=j
Print x, a
End Sub
Private Sub Form_Click( )
Dim x As Integer
x=0
Do While x<50
x=(x+2)*(x+3)
n=n+1
Loop
Print x,n
End Sub
Dim G As Integer
Dim M As Integer
Input “输入重量 G = ”; G
If then
M=0.65*G
Else
M=
End if
Print “运费为:”; M
i=4
a=5
If i > 3 Then a = a + 5
Else a = a + 2
End If
写出本程序段运行后,变量a的值。
c = 0
For i = 1 To 12
If 12 Mod i = 0 Then
c = c + 1
End If
Next i
Text1.Text = Str(c)
程序运行后,在文本框中输出为:。
Private Sub Command1_Click( )
Dim s, j As Single
s=
For j=1 to 50
If Then
s=s*j
Else
s=
End if
Next j
print “s=”:s
End Sub
试在横线处填写适当的内容,使程序得到相应的计算结果。
from microbit import *
while True:
water_ level =pinl. read_ analog () #将p1引脚的模拟值设为变量“water_ level”
if water_ level<300:
display. show (Image. SAD)
else:
display. show (Image. HAPPY)
x=6
If x <= 5 Then
y = 2 * x + 1
Else
y = x / 2
End If
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 |
a=5
if :
print("YES")
n=(input("参加运动会项目名次(1~6):")) # 计算并输出得分
print("得分为14分") elif mc==2: print("得分为10分") elif mc==3: print("得分为8分") elif mc==4: print("得分为6分") elif mc==5: print("得分为4分") elif mc==6: print("得分为2分")
print("输入的名次不在1~6范围") # 方法二 f=[14,10,8,6,4,2] if n>=1 n<=6: print("项目得分为:",cj,"分") else: print("输入的名次不在1~6范围") |
请在完成填空。
chengji = int( input("请输入百分成绩"))
if chengji >= 85:
print("成绩为:优秀")
else:
print("成绩为:良好")
x=10
if x>=10:
Value=3*x
else:
Value=5*x+10
m=19
if m>=30 or m<20:
print(m)