Private Sub Form_Click() Dim n As Integer, i As Integer, sum As Integer n = Val(InputBox("凳迟请输丛缺入个数N:", "输枣郑李入", 5)) For i = 1 To n sum = sum + i * 2 - 1 Next Print sum End Sub
Private Sub Form_Click() Dim x As Integer Dim y As Integer x = 漏茄InputBox("输入", , 5) For y = x 腔消To 1 Step -1 If y Mod 2 <> 0 Then k = k + y End If Next y Print k End Sub