Algorytmy w formie graficznej

Schematy blokowe

0x08 graphic
0x08 graphic
START

0x08 graphic

STOP

0x08 graphic
0x08 graphic

0x08 graphic

0x08 graphic

0x08 graphic

0x08 graphic
NIE

Przykłady

Napisz algorytmy obliczające następujące wartości


  1. Obliczyć s:=a+b+c

0x08 graphic
0x01 graphic

  1. Wyznaczyć m=max{a,b}

0x08 graphic
0x01 graphic


0x08 graphic
0x08 graphic

  1. Wyznaczyć max{a,b,c}

0x08 graphic
0x01 graphic

  1. Wyznaczyć s:=1+2+3+4+5 5. Wyznaczyć s:=1+2+3+….+n

0x08 graphic
0x01 graphic
0x08 graphic
0x01 graphic

  1. Oblicz pierwiastki dowolnego trójmianu kwadratowego

0x01 graphic

0x08 graphic
0x01 graphic

WE

WY

a,b,c WE

S:=a+b+c

S WY

START

STOP

STOP

max:=a WY

a>b

a,b WE

START

TAK

a>c

STOP

max:=b WY

max:=a WY

NIE

TAK

max:=b WY

TAK

NIE

NIE

TAK

b>c

max:=c WY

a>b

STOP

a,b,c WE

START

S WY

s:=1+2+3+4+5

NIE

START

TAK

i:=i+1

i<=n

STOP

s WY

n WE

START

s:=0, i:=1

s:=s+i, i:=i+1

TAK

Delta:=b*b-4*a*c

NIE

TAK

0x01 graphic

Delta>0

STOP

x1, x2 WY

a,b,c WE

START

0x01 graphic

0x01 graphic

Delta=0

Nie ma pierwiastków WY

x0 WY

NIE