我的任務是創建一個Visual Basic控制檯腳本,要求用戶連續5次向數組中輸入一個數字(銷售數字爲千),然後將這些結果顯示爲一種理貨圖表。Visual Basic將數組整數(x)轉換爲單個字符的x值
例如,對於數據:銷售(10,7,12,5,15) 輸出將
2008:++++++++++
2009:+++++++
2010:++++++++++++
2011:+++++
2012:+++++++++++++++
到目前爲止的代碼,我有:
Module Module1
Sub Main()
Dim sales(4) As Integer
Dim index As Integer
Dim year As Integer
For index = 0 To 4
Console.Write("Enter your sales numbers (in thousands): ")
sales(index) = Console.ReadLine()
Next
year = 2007
For index = 0 To 4
year = (year + 1)
- --not肯定代碼在這裏---
Console.WriteLine(year & ": " & ????????)
Next
Console.ReadLine()
End Sub
End Module
我如何整數值從ARR內改變只是不確定a成一定數量的單個字符。
爲什麼不只是新的字符串(「+」c,i)? – 2012-04-02 14:30:08
因爲我總是忘記構造函數超載;) – 2012-04-02 14:38:43