程序代码如下:
Private Sub Form Click()
Dim ji As Integer ‘鸡
Dim tu As Integer ‘兔
Dim tui As Integer ‘腿数
Dim tou As Integer ‘头数
For ji=
For tu=1 to 25
tui= ‘计算腿的数量
tou= ji+tu ‘计算头的数量
IFThem
Print ji, tu
End If
Next tu
Next ji
End sub

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
score=int (input ("请输入考试成绩"))
if score>=90:
print("A")
elif score>=80:
print("B")
elif score>=70:
print("C")
elif score>=60:
print("D")
else:
print("E")
list1=[1,2,5, 6,9]
for item in list1:
print()
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command2_Click()
Dim a As Single, b As Single, c As Single
Dim x1 As Single, x2 As Single, det As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
det = ‘(根的判别式b2-4ac)
Select Case det
Case Is > 0
x1 = (-b + Sqr(det)) / (2 * a)
x2 = (-b - Sqr(det)) / (2 * a)
Text4.Text = "方程有两个实数根" & " x=" & Str(x1) & " x=" & Str(x2)
Case Is = 0
Text4.Text = "方程有两个相等的实数根 x=" & Str(x1)
Case
Text4.Text = "此方程无实数根"
End Sub
b=1
Do while (b<40)
b=b*(b+1)
Loop
Print b
x=5
y=-6
If Not x>0 Then x=y-3 Else y=x+3
Print x-y; y-x
下列程序的功能是:当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
s=1
for i=1 to 3
s=s+1
next i
该程序段运行后,变量s的值为( )
a=int(input( ))
if a>0:
print("正整数")
elif a<0:
print("负整数")
else:
print("零")
负整数
零
B . 正整数 C . 负整数 D . 零s=0
for i in range(1,21) :
s=
print (s)
1)系统随机生成一个1~100的数字;
2)用户总共有5次猜数字的机会;
3)如果用户猜测的数字大于系统给出的数字,打印“too big";
4)如果用户猜测的数字小于系统给出的数字,打印"too small";
5)如果用户猜测的数字等于系统给出的数字,打印"恭喜",并且退出循环;
编写程序代码如下,请完善代码:
#导入random模块
#随机生成1-100的整数并赋值给变量game
time=5
while time>0:
guess=int (input ("请输入你所猜的数字:"))
if (guess>game) :
print ("too big")
elif :
print(" too small' )
else:
print ("恭喜”)
break
time=time-1
print("游戏结束,正确的结果是:",game)
Num1=9
Num2=14
age=(Num1+Num2)/2
print(age)
str1="key"
str2="board"
print( str1+str2 )
Num1=3
Num2=4.8
print(Num1,Num2)
