'此函数作用是执行递加操作,如N=5,则函数结果是=1+2+3+4+5=15Public Function P(N As Integer) Dim Sum As Integer Sum=0 For i=1 To N Sum=Sum+iNext i P=SumEnd Function所以S=P(1)+P(2)+P(3)+P(4)=1+3+6+10=20