main()
{ int i,s;
for (i=1,s=0;i<=100;i=i+3;)s=s+i;
printf("1+4+7+……+100 = %d ", s);
}
var num:uint;
for(var i:uint=1;i<=100;i+=3)
{
num+=i;
}
trace(num);
结果是1717
Private Sub Form_Click()
Dims&, n%
s =0
Forn = 1 To 100 Step 3
s = s + n
Next
Print s
End Sub
循环 结果相加