This is much more abstract than that.
For i = 1, 2, ..., n
For j = i + 1, i + 2, ..., n
Add up array entries A[i] through A[j]
Store the result in B[i, j]
Endfor
Endfor
For example, the outer loop:
For i = 1, 2, ..., n
Runs n times
The second loop:
For j = i + 1, i + 2, ..., n...