Private Sub bai13_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim n%
n = InputBox("Nhập n ")
MsgBox(TongS(n))
End Sub
Private Function TongS(ByVal n%) As Integer
Dim i%, s%
For i = 1 To n
s = -s + i
Next
TongS = s
End Function
End Class