试在窗体中以隔行方式输出10行随机英语大写字母,每行显示52个字符。这一题,我试过了,但是不对,下标会越界,而且,也不能按照输出10行

xiaoyanzixiaoyanzi8 2003-03-10 08:55:16
这一题,我试过了,但是不对,下标会越界,而且,也不能按照输出10行随机英语大写字母。


Private Sub Command1_Click()

Dim Letter(9, 51) As String
Dim I, j As Integer

For j = 1 To 10
For I = 1 To 52
LetterAscii = Int(Rnd * 26) + 65
Letter(I, j) = Chr(LetterAscii)
Print Letter(I, j);
Next I
Next j


End Sub
...全文
127 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
northwolves 2003-03-10
  • 打赏
  • 举报
回复
楼上几位i,j颠倒了,应该这样:


Private Sub Command1_Click()

Dim Letter(9, 51) As String
Dim i, j As Integer
Randomize
For i = 0 To 9
For j = 0 To 51
Letter(i, j) = Chr(Int(Rnd * 26) + 65)
Print Letter(i, j);
Next
Print
Next
End Sub
hfrui 2003-03-10
  • 打赏
  • 举报
回复
Dim Letter(9, 51) As String
Dim I, j As Integer

For j = 0 To 9
For I = 0 To 51
LetterAscii = Int(Rnd * 26) + 65
Letter(I, j) = Chr(LetterAscii)
Print Letter(I, j);
Next I
print '换行
Next j
用户 昵称 2003-03-10
  • 打赏
  • 举报
回复
Private Sub Command1_Click()

Dim Letter(1 to 10, 1 to 52) As String '''''''''''''
Dim I, j As Integer

For j = 1 To 10
For I = 1 To 52
LetterAscii = Int(Rnd * 26) + 65
Letter(I, j) = Chr(LetterAscii)
Print Letter(I, j);
Next I
Next j


End Sub
ClientDC 2003-03-10
  • 打赏
  • 举报
回复
Dim Letter(9, 51) As String
Dim I, j As Integer

For j = 0 To 9
For I = 0 To 51
LetterAscii = Int(Rnd * 26) + 65
Letter(I, j) = Chr(LetterAscii)
Print Letter(I, j);
Next I
Next j

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧