Dim?str?As?String?=?"",?temp,?n?As?Integer
創(chuàng)新互聯(lián)公司從2013年開始,是專業(yè)互聯(lián)網(wǎng)技術服務公司,擁有項目網(wǎng)站設計、成都網(wǎng)站制作網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元景洪做網(wǎng)站,已為上家服務,為景洪各地企業(yè)和個人服務,聯(lián)系電話:13518219792
Dim?str1?As?String?=?"12,45,2,9,41,31,66,83,2,1,-9,-91,-21"
Dim?a()?As?String?=?Split(str1,?",")
For?i?=?1?To?UBound(a)?Step?1
a(i)?=?Val(a(i))
Next
temp?=?0
n?=?0
For?i?=?1?To?UBound(a)
If?a(i)??temp?Then
temp?=?a(i)
End?If
If?a(i)??0?Then
n?=?n?+?1
End?If
Next
str?=?str??"正數(shù)的個數(shù)為?"??n
str?=?str??"最大元素的下標為?"
For?i?=?1?To?UBound(a)
If?a(i)?=?temp?Then
str?=?str??i??"?"
End?If
Next
TextBox6.Text?=?str
(1)先在窗口上放一個text1,選中它,擊右鍵,選“復制”
(2)再在窗口上單擊右鍵,選“粘貼”,即形成了一個文本框數(shù)組
(3)重復第二步,多粘貼幾次,即可產(chǎn)生具有多個元素的文本框數(shù)組
Dim?str?As?String?=?"",?temp,?n?As?Integer
Dim?str1?As?String?=?"12,45,2,9,41,31,66,83,2,1,-9,-91,-21"
Dim?a()?As?String?=?Split(str1,?",")
For?i?=?1?To?UBound(a)?Step?1
a(i)?=?Val(a(i))
Next
temp?=?0
n?=?0
For?i?=?1?To?UBound(a)
If?a(i)??temp?Then
temp?=?a(i)
End?If
If?a(i)??0?Then
n?=?n?+?1
End?If
Next
str?=?str??"正數(shù)的個數(shù)為?"??n
str?=?str??"最大元素的下標為?"
For?i?=?1?To?UBound(a)
If?a(i)?=?temp?Then
str?=?str??i??"?"
End?If
Next
TextBox6.Text?=?str