vb中如何輸出一個n行n列的矩陣?
OptionBase1 PrivateSubForm_Load() Dima(10,10)AsInteger Dimj,i Show Fori=1To10 Forj=1To10 Ifi=jOri=11-jThen a(i,j)=1 Else a(i,j)=0 EndIf Nextj Nexti Fori=1To10 Forj=1To10 Printa(i,j); Nextj Print Nexti EndSub
vb中如何輸出一個n行n列的矩陣?
OptionBase1 PrivateSubForm_Load() Dima(10,10)AsInteger Dimj,i Show Fori=1To10 Forj=1To10 Ifi=jOri=11-jThen a(i,j)=1 Else a(i,j)=0 EndIf Nextj Nexti Fori=1To10 Forj=1To10 Printa(i,j); Nextj Print Nexti EndSub