修改时间:2024-07-13 浏览次数:241 类型:期末考试
Private Sub Command1_ Click ()
Dim i As Integer
Dim s As String, s2 As String
s =Text1. Text
For i=1ToLen(s)
s2 = Mid(s,i,1)
List1.AddItem s2 & ":”& Str (Asc (s2))
Next i
End Sub
则程序界面上用于输出的控件的图标为( )
Dim i As Integer, C As Integer
Dim s As String, min As String, ch As String
s = Text1. Text
min ="z":c=0
For i=1 To Len(s)
ch = Mid(s, i, 1)
If ch>=“a”And ch<=“z”And ch<min Then
min=chc=1
ElseIf ch = min Then
c=c+1
End If
Next i
Label1.Caption = Str (c)
在文本框Text1中输入“Twinkle, twinkle, little star.”,程序执行后,标签Label1中显示的内容是( )
注: Rank 函数用于返回某数字在一组数字中相对于其他数字的大小排名.
例如:=Rank (B13,E13:B20, 0)表示高二1班班级赛总分[B13]在整个年级[区域B13: B20]中的降序[0:降序,1:升序]排名。
场景名:片头 |
类别序号:1 |
进入方式: 开始播放即进入。 |
呈现方式: ①“树”在舞台左下方由小变大,持续1.5秒,变大的树状态保持到最后。 ②“退出”按钮位于舞台右下角,单击该按钮跳转到“片尾"场景第1帧并继续播放。 (其他略) |
呈现顺序: ①开始时出现“树”动画、文字和音乐。 ②1.5秒时出现“飞鸟”动画。 ③最后出现“退出”和“播放”按钮,本场景结束并停止播放。 (其他略) |
根据上述脚本,在Flash软件中编辑“片头”场景,部分界面如图所示。
如:输入十进制数35,将其转换为二进制数为100011,其中最长连续数字是3个“0”。程序运行界面如图所示。
Private Sub Command1_Click()
Dim n As Integer, i As Integer, j As Integer, m As Integer
Dim s As String, ch As String, ch1 As String, ch2 As String
n = Val (Text1. Text)
Do While n<>0
s=CStr(n Mod 2)+s ‘CStr将数字转化为字符串,但不会有前导空格
Loop
ch1 = Mid(s, 1, 1): ch = ch1
i=2:j=1:m=0
For i=2 To Len(s)
ch2 = Mid(s, i, 1)
If Then
If i-j> m Then
m=i-j
ch = ch1
End If
ch1 = ch2
End If
Next i
Text2. Text = Str(m) & “个”& ch
End Sub
Private Sub Command1_ Click()
Dim i As Integer, j As Integer, n As Integer, flag As Boolean
Dim st As String, szm As String, ch As String, word As String, tmp As String
st = Text1. Text
szm = Text2. Text
flag = True: n=0
For i=1 To Len(st)
If ch = szm And flag = True Then
n=n+1: word = ch
For j=i+1 To Len(st)
tmp = Mid(st, j, 1)
If tmp<>””And tmp <>”.”And tmp <>“,” Then
Else
List1. AddItem Str(n) +“.”+ word
i=j
Exit For
End If
Next j
ElseIf ch=“” Or ch=“,” Or ch= “.”Then
Else
flag = False
End If
Next i
Label1.Caption=“字母”+ szm +“开头的单词总数:”+ str(n)
End Sub
试题篮