1 d = float(input(请输入纸的厚度mm:))
2 h = d / 1000
3 n=0
4 while
5 n+=1
6 h*=2
7 print(“厚度为", d ,"毫米的纸折叠", n ,"次后高度达到" , h ,"米")
例如: 输入报名序号“2022150001”,输出“普通综合类”
while True:
ticket= ①
num=0
for i in ticket:
if i>="0" and i<="9":
num=num+1
If len(ticket)!=10:
print("输入长度不符合要求")
elif ②
print("输入存在非数字字符")
else:
break
dic={"13":"普通艺术类","14":"普通体育类","15":"普通综合类","23":"单项艺术类","24":"单项体育类","25":"单项综合类"}
s=dic[ticket[4:6]]
print("该考生的考试科类为:",s)
①②
a = 90
b = 50
i = 0
While:
a = a - 12
i = i + 1
print('第',i,'次运走后甲仓和乙仓的数量为:',a,b)
print('两仓剩下大米袋数相等所需要运行的次为:',i)
实现上述功能的VB程序如下,请回答下列问题:
Dim n As Integer
Dim L As String
Dim i as Integer
Dim j as Integer
Dim a(1 To 100) As Integer
Dim b(1 To 100) As Integer
Private Sub Command1_Click()
n = Val(Text1.Text)
Randomize
For i = 1 To n * n
a(i) = + 1
Next i
For i = 1 To n
L = ""
For j = 1 To n
L = L + " " + Str(a((i - 1) * n + j))
Next j
List1.AddItem L
End Sub
Private Sub Command2_Click()
List2.Clear
b((i - 1) * n + j) =
L = L + " " + Str(b((i - 1) * n + j))
List2.AddItem L
a(i) =