Current location - Training Enrollment Network - Mathematics courses - Mathematics algorithm of senior one. Use VB language
Mathematics algorithm of senior one. Use VB language
Sum= 1 // used to remember the total ~

X=2 // Let him cycle from 2 to 20. Why from 2? Because sum= 1 adds one.

The second period Y= 1 //.

And x & lt=20 // matches WEND ~ From WHILE to WEND is a piece.

Defense Order (defense order)

y=y*(y+ 1)

y=y+ 1

Loop until y & gtx- 1

x=x+ 1

Sum = sum +y

y= 1

line

Print sum