This looks a little academic, so just in case I'll explain versus writing code here:
- Loop over your data pushing the data points into an array
- Track a 'running_total' of the values along the way
- If size of array < 99, goto start
- calc & print average
- shift array and subtract that amount from your running_total
- end of loop;