看到都觉得羞耻,这么多改盯历人乱发核搜程序来骗分,丢脸,以下则伍是正确答案
Private Sub Form_Click()
Me.Cls
Dim i, Sum As Single
For i = 1 To 100
Sum = Sum + i * (-1) ^ (i - 1)
Next i
Print Sum
End Sub
VB的:
Private Function js()
Dim s, i As Integer
For i = 1 To 100 Step 1
If i Mod 2 = 0 Then
s = s - i
Else
s = s + i
End If
Next
js = s
End Function
main()
{
int s=0;
for(int i=1;i<101;i++)
{
if(i%2==0)
i=-i;
s+=i;
}
}
dim s%塌灶亏团神辩铅
FH=1
for i =1 to 100 step 1
s=s+i
FH = -FH
Next i