i = 1
S = 0? (Error: S= 1)
n = 0
And S<= 500? (error: DO)
S = S + i
i = i + 1
n = n + 1
line
Print n? (Error: n+ 1)
end
In fact, in the algorithm given in this question, the functions of variables n and I are similar, and one can be completely removed to make the algorithm simpler:
The following flow chart is better: