Suma n liczb (przy czym n jest znane).

0+5=5

5+7=12

12+(-1)=11

11+4=15

Specyfikacja:

dane:

n - ilość liczb do zsumowania, n>0

0x08 graphic
qwerty - sumowany składnik, n należy do R

Wynik:

wynik - suma n liczb, wynik należy do R

0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic
0x08 graphic

Start

czytaj n

wynik:=0

n>0

N

pisz wynik

STOP

T

czytaj qwerty

wynik:=wynik+qwerty

n:=n-1

n

wynik

qwerty

5

?

?

5

0

?

5

0

4

4

4

4

4

4

6

3

10

6

3

10

-2

2

8

-2

2

8

3

1

11

3

1

11

6

0

17

6

4, 6, -2, 3, 6