编号 | APP名称 | 分类 | 容量 | 星级评分 | 最近更新 | 开发者 | 是否网络 |
1 | keep | 生活 | 62.1MB | 3.4 | 2021/04/03 | 北京卡路里 | 是 |
2 | 猿辅导 | 教育 | 71.7MB | 4.2 | 2021/04/06 | 北京猿力教育 | 是 |
3 | 单机切水果 | 游戏 | 40.9MB | 3.0 | 2020/07/21 | 广州银辉通讯 | 否 |
… | … | … | … | … | … | … |
下列关于“基本信息”数据表的描述,错误的是( )
If y > 0 Then y = -y
D . y = xIf x < 0 Then y = -x
Const SN = "〇一二三四五六七八九十百千"
Dim s1 As String, s2 As String, i As Integer
s1 = Text1.Text: s2 = "": i = 1
Do While i < Len(s1)
n1 = Val(Mid(s1, i, 1))
n2 = Val(Mid(s1, i + 1, 1))
If n1 <> 0 Then
If n1 = 0 And n2 <> 0 Then
i = i + 1
Loop
n1 = Val(Mid(s1, i, 1))
If n1 <> 0 Then
Text2.Text = s2
上述程序方框处可选语句为:
①s2 = s2 & Mid(SN, n1 + 1, 1) & Mid(SN, Len(s1) - i + 10, 1)
②s2 = s2 & Mid(SN, 1, 1)
③s2 = s2 & Mid(SN, n1 + 1, 1)
则(1)、(2)、(3)处语句依次是( )
Dim a(1 To 6) As Integer
‘产生6个1-100的随机数,存放到数组a中,代码略
For i = 1 To 3 Step 2
If a(i) < a(i + 2) Then
tmp = a(i): a(i) = a(i + 2): a(i + 2) = tmp
End If
Next i
执行该程序段后,数组元素a(1)到a(6)的值不可能的是( )
s = "AAABBBCCCCDDEFF"
i = 1: j = Len(s): Key = "H": v = ""
Do While i <= j
m = (i + j) \ 2
c = Mid(s, m, 1)
If c = Key Then Exit Do
If c > Key Then
j = m - 1: v = v & c
ElseIf c < Key Then
i = m + 1: v = v & c
End If
Loop
执行完以上程序后,v的值为( )
(提示:占总人口比重=年龄段人口数÷总计人口数×100)
图b
图b
最终得分=(所有评委打分总和-1个最高分-1个最低分)×项目难度系数
编写VB程序,实现计算最终得分的功能。在文本框Text1中输入项目难度系数和多位评委的打分,中间用“,”隔开并以“,”结尾,然后点击计算按钮,在文本框Text2中显示最终得分。程序运行界面如图所示。
Private Sub Cmd1_Click()
Dim a(1 To 100) As Single
Dim i As Integer, j As Integer, k As Integer, m As Integer, n As Integer
Dim Tot As Single, tmp As Single
Dim s As String, v As String, ch As String
s = Text1.Text
n = 1:v=""
Do While n <= Len(s)
ch = Mid(s, n, 1)
If ch <> "," Then
v = v & ch
Else
a(m) = Val(v)
m = m + 1
End If
n = n + 1
Loop
For i = 2 To m - 2
For j = m - 1 To i + 1 Step -1
If a(i) < a(j) Then
tmp = a(i): a(i) = a(j): a(j) = tmp
End If
Next j
Next i
Tot = 0
For
Tot = Tot + a(i)
Next i
Text2.Text =
End Sub
1)根据字符串长度构建一个最小的n*n矩阵,将字符串中每个字符从左到右,自上而下顺序填入矩阵,不足部分用字符“*”代替;
2)将矩阵转置(行列对换),然后将奇数行字母内码加上1,偶数行字母内码减1,字符为a、z或A、Z时做循环处理。比如,字符a减1为z;字符Z加1为A。
3)按从左到右,从上而下依次取出字符,形成新的字符串。如图a为字符串“Go to the zoo.”的加密过程。编写VB程序,在文本框Text1中输入字符串,点击“加密”按钮,在文本框Text2中输出加密后的字符串。程序运行结果如图b所示。
图a |
图b |
Dim a(1 To 100) As String, b(1 To 100) As String, n As Integer
Private Sub Command1_Click()
Dim s1 As String, s2 As String,i As Integer, j As Integer, m As Single
s1 = Text1.Text
m = Sqr(Len(s1))
If m > Int(m) Then n = Int(m) + 1 Else n = m
For i = 1 To n * n
If i <= Len(s1) Then a(i) = Mid(s1, i, 1) Else a(i) = "*"
Next i
For i = 1 To n
For j = 1 To n
b((i - 1) * n + j) = ‘将矩阵转置
b((i - 1) * n + j) = jm(i, j) ‘内码变换
Next j
Next i
s2 = ""
For i = 1 To n * n
s2 = s2 & b(i)
Next i
Text2.Text = s2
End Sub
Function jm(x As Integer, y As Integer) As String
Dim s As String
s = b((x - 1) * n + y)
If s <= "Z" And s >= "A" Or s <= "z" And s >= "a" Then
If x Mod 2 <> 0 Then
If s <> "Z" And s <> "z" Then
s = Chr(Asc(s) + 1)
Else
s = Chr(Asc(s) - 25)
End If
Else
If s <> "a" And s <> "A" Then
s = Chr(Asc(s) - 1)
Else
s =
End If
End If
End If
End Function