下列VB程序运行时,单击命令按钮Command1后,文本框Text1中显示的内容是1010,文本框Text2中显示的内容是44.
Private Sub Command1_Click( )
D im iA s Integer,cA s Integer,nA s Integer
c=0:n=10
For i=1To n
If n Mod i=0Then c=c+1
Next i
Text1.Text=Str(n)
Text2.Text=Str(c)
End Sub.
【考点】选择语句.
【答案】10;4
【解答】
【点评】
声明:本试题解析著作权属菁优网所有,未经书面同意,不得复制发布。
发布:2024/6/27 10:35:59组卷:8引用:1难度:0.9
相似题
-
1.编写程序查找字符串中最长连续相同字符的长度:
横线处可选代码为:①h②h=0③h=h+1④Mid(s,i,l)=Mid(s,i+1,1)⑤Mid(s,i,1)=Mid(s,i-1,1),则①②③处语句依次为( )发布:2025/1/2 10:30:2组卷:1引用:1难度:0.4 -
2.有程序代码如下,输入某数据后,输出结果为“B”。那么输入的数据可能是( )
Dim score As Integer
score=Val(InputBox(“score:“))
If score>89 Then
Print“A“
Else
If score>59 Then
Print“B“
Else
Print“C“
End If
End If发布:2025/1/2 12:0:1组卷:0引用:1难度:0.6 -
3.下列选项中,与语句“Ifx>188 Then y=x*0.5 Else y=x*0.8“功能相同的是( )
发布:2025/1/2 10:30:2组卷:1引用:2难度:0.5