vb程式設計題

2021-05-02 11:22:19 字數 1502 閱讀 9943

1樓:憂鬱的小風風

dim a(,) as integer = , , , }

dim i, j as integer

dim temp as string

'全部數字

for i = 0 to 3

for j = 0 to 3

temp = temp + a(i, j).tostring + " "

next

temp = temp + chr(10)

next

richtextbox1.text = temp

temp = ""

'對角線

for i = 0 to 3

temp = temp + a(i, i).tostring + " "

next

temp = temp + chr(10)

for i = 0 to 3

temp = temp + a(i, 3 - i).tostring + " "

next

richtextbox2.text = temp

temp = ""

'更行各列和

dim sumx, sumy as integer

for i = 0 to 3

for j = 0 to 3

sumx = sumx + a(i, j)

sumy = sumy + a(j, i)

next

temp = temp + sumx.tostring + " " + sumy.tostring + " " + chr(10)

sumx = 0

sumy = 0

next

richtextbox3.text = temp

temp = ""

'更換位置

dim b(3, 3) as integer

for i = 0 to 3

for j = 0 to 3

if i = 0 or i = 2 then

b(i, j) = a(2 - i, j)

else

b(i, j) = a(i, j)

end if

next

next

for i = 0 to 3

for j = 0 to 3

if j = 1 or j = 3 then

a(i, j) = b(i, 4 - j)

else

a(i, j) = b(i, j)

end if

temp = temp + a(i, j).tostring + " "

next

temp = temp + chr(10)

next

richtextbox4.text = temp

怎麼排你看著辦吧,拖入4個richtextbox就行了,說真的,你的10分不好賺啊

2樓:匿名使用者

憂鬱的小風風 答的不錯哦

vb程式設計題

private sub form load form1.caption vb程式 form1.forecolor h0000ff end sub private sub form click print vb程式設計基礎 end sub 如果要求只能用一條語句的話,那就在form click 裡面用...

vb程式設計題,請高手解答

private sub mand1 click dim a as integer,n as integerdim b as integer,m as integerdim c as integer,nc as integerdim i as integer,j as integer,tm as in...

VB程式設計,vb程式設計是什麼?

51 len函式,檢測字元成的長度。right函式,從右邊在指定的字串中擷取一定數量的字元組成新的字串。52 dim a 9 as nteger 惠用紅色標註這一行,不能執行。以下省略。vb程式設計是什麼?1 vb程式設計以visual basic 6.0簡體中文版為語言背景,深入淺出的介紹visu...