1.选择题- (共10题)
①6542-2456=4086 ②8640-0468=8172 ③8721-1278=7443 ④7443-3447=3996
⑤9963-3699=6264 ⑥6642-2466=4176 ⑦7641-1467=6174
编写程序实现实现上述功能。从文本框Text1中输入一个任意的数字不完全相同的四位正整数,在文本框Text2中输出掉进黑洞的步数。实现上述功能的VB代码如下,但加框处代码有错,请改正:
Private Sub Command1_Click()
Dim a(1 To 4) As Integer, c As Integer, t As Integer
Dim x As Integer, y As Integer, i As Integer, j As Integer
x = Val(Text1.Text)
c = 0
Do While x <> 6174
For i = 1 To 4 '把四位正整数x的每一位数字取出并存放到数组a中
a(i) = x Mod 10
' (1)
Next i
For i = 1 To 3
For j = i + 1 To 4
If Then ' (2)
t = a(i): a(i) = a(j): a(j) = t
End If
Next j
Next i
x = a(1) * 1000 + a(2) * 100 + a(3) * 10 + a(4)
y = a(1) + a(2) * 10 + a(3) * 100 + a(4) * 1000
x = x - y
c = c + 1
Loop
Text2.Text = Str(c)
End Sub
⑴{#blank#}1{#/blank#} ⑵{#blank#}2{#/blank#}
①6542-2456=4086 ②8640-0468=8172 ③8721-1278=7443 ④7443-3447=3996
⑤9963-3699=6264 ⑥6642-2466=4176 ⑦7641-1467=6174
编写程序实现实现上述功能。从文本框Text1中输入一个任意的数字不完全相同的四位正整数,在文本框Text2中输出掉进黑洞的步数。实现上述功能的VB代码如下,但加框处代码有错,请改正:
Private Sub Command1_Click()
Dim a(1 To 4) As Integer, c As Integer, t As Integer
Dim x As Integer, y As Integer, i As Integer, j As Integer
x = Val(Text1.Text)
c = 0
Do While x <> 6174
For i = 1 To 4 '把四位正整数x的每一位数字取出并存放到数组a中
a(i) = x Mod 10
' (1)
Next i
For i = 1 To 3
For j = i + 1 To 4
If Then ' (2)
t = a(i): a(i) = a(j): a(j) = t
End If
Next j
Next i
x = a(1) * 1000 + a(2) * 100 + a(3) * 10 + a(4)
y = a(1) + a(2) * 10 + a(3) * 100 + a(4) * 1000
x = x - y
c = c + 1
Loop
Text2.Text = Str(c)
End Sub
⑴{#blank#}1{#/blank#} ⑵{#blank#}2{#/blank#}
①6542-2456=4086 ②8640-0468=8172 ③8721-1278=7443 ④7443-3447=3996
⑤9963-3699=6264 ⑥6642-2466=4176 ⑦7641-1467=6174
编写程序实现实现上述功能。从文本框Text1中输入一个任意的数字不完全相同的四位正整数,在文本框Text2中输出掉进黑洞的步数。实现上述功能的VB代码如下,但加框处代码有错,请改正:
Private Sub Command1_Click()
Dim a(1 To 4) As Integer, c As Integer, t As Integer
Dim x As Integer, y As Integer, i As Integer, j As Integer
x = Val(Text1.Text)
c = 0
Do While x <> 6174
For i = 1 To 4 '把四位正整数x的每一位数字取出并存放到数组a中
a(i) = x Mod 10
' (1)
Next i
For i = 1 To 3
For j = i + 1 To 4
If Then ' (2)
t = a(i): a(i) = a(j): a(j) = t
End If
Next j
Next i
x = a(1) * 1000 + a(2) * 100 + a(3) * 10 + a(4)
y = a(1) + a(2) * 10 + a(3) * 100 + a(4) * 1000
x = x - y
c = c + 1
Loop
Text2.Text = Str(c)
End Sub
⑴{#blank#}1{#/blank#} ⑵{#blank#}2{#/blank#}
2.单选题- (共4题)
3.填空题- (共3题)
4.解答题- (共6题)
信息一:甲工厂单独加工完成这批产品比乙工厂单独加工完成这批产品多用10天;
信息二:乙工厂每天加工的数量是甲工厂每天加工数量的1.5倍.
根据以上信息,求甲、乙两个工厂每天分别能加工多少件新产品.
-
【1】题量占比
选择题:(10道)
单选题:(4道)
填空题:(3道)
解答题:(6道)
-
【2】:难度分析
1星难题:0
2星难题:0
3星难题:0
4星难题:0
5星难题:0
6星难题:3
7星难题:0
8星难题:1
9星难题:9