VB 6.0

2008-07-24 1:56 am
由鍵盤輸入陣列 a 內的5個數,把a(1)的值存到a(2),把a(2)的值存到a(3), 直到a(5)之後,存回到 a(1)內,之後打印陣列

例如:

12345

變成

51234

我想問要點打呢

回答 (1)

2008-07-24 10:19 am
✔ 最佳答案
high = UBound(a)
low = LBound(a)
temp = a(high)
For i = high To low + 1 Step -1
a(i) = a(i - 1)
Next
a(low) = temp

For i = low To high
s = s & a(i)
Next
Debug.Print s


收錄日期: 2021-04-25 20:32:49
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080723000051KK02266

檢視 Wayback Machine 備份