#include
int main()
{
int i,sum=0;
for(i=0;i<100;i++)
if((!(i%3))||(!(i%7)))
sum+=i*i;
printf("%d\n",sum);
return 0;
}
Private Sub Command1_Click()
Dim i, j, sum As Integer
For i = 1 To 100
j = i Mod 21
If j = 0 Then sum = sum + i ^ 2
Next i
Print sum '打印和
End Sub
Private Sub Command1_Click()
Dim i, j, sum As Long
sum = 0
For i = 1 To 100
If (i Mod 3 = 0) Or (i Mod 7 = 0) Then sum = sum + i ^ 2
Next i
Print sum
End Sub