可以用vb輸出一個二維的數(shù)字方陣嗎
只要這樣的1 2 2 22 1 2 22 2 1 22 2 2 1
Dim str As String, n As Integerstr = InputBox("", "輸入n")n = CInt(str)Dim i As Integer, j As Integer, ar(n) As Integer, str1 As StringFor j = 1 To nFor i = 0 To n - 1ar(i) = CInt(Rnd() * 100)If str1 = "" Thenstr1 = ar(0)Elsestr1 = str1 + " " + CStr(ar(i))End IfNextIf ListBox1.Text = "" Then'ListBox1.Text = CStr(str1)ListBox1.Items.Add(CStr(str1))ElseListBox1.Text = ListBox1.Text + Chr(13) & Chr(10) + str1End Ifstr1 = ""Next 在ListBox1中輸出n個0到100的隨機(jī)數(shù)有問題在線聯(lián)系.....
相關(guān)推薦
便查問答是一款實(shí)用的網(wǎng)絡(luò)熱門知識問答平臺,專注于分享你不知道的知識,、經(jīng)驗(yàn)及生活問題,,在這里所有人都能找到答案歡迎網(wǎng)友參與討論。