- Tham gia
- 8/6/06
- Bài viết
- 14,576
- Được thích
- 22,898
- Nghề nghiệp
- U80
PHP:
Sub LapDoanhThuDoiPho()
ReDim Arr(1 To 1, 1 To 13) As Double
Dim J As Integer, DT As Double, Tmp As Long
Const DTN As Double = 1.2 * 10 ^ 7
Randomize
For J = 1 To 12
Tmp = 9 + 10 ^ 5 * Rnd() / 1
If Tmp Mod 2 = 0 Then
Arr(1, J) = DTN / 12 + Tmp
Else
Arr(1, J) = DTN / 12 - Tmp
End If
Arr(1, 13) = Arr(1, 13) + Arr(1, J)
Next J
[A3].Resize(, 13).Value = Arr()
End Sub