计算并输出 S = ∑ xi x yi ( i=1 … 10) 其中xi的值分别为 1,2,3,4,5,6,7,8,9,10 ;yi的值分别

问题描述:

计算并输出 S = ∑ xi x yi ( i=1 … 10) 其中xi的值分别为 1,2,3,4,5,6,7,8,9,10 ;yi的值分别
计算并输出 S =∑ xi x yi( i=1 … 10)
其中xi的值分别为 1,2,3,4,5,6,7,8,9,10 ;yi的值分别为 11,12,13,14,15,16,17,18,19,20.

Private Sub Command1_Click()
Dim x(10) As Integer,y(10) As Integer
s = 0
For i = 0 To 9
x(i) = i + 1
y(i) = i + 11
s = s + x(i) * y(i)
Next i
Print s
End Sub