Documente Academic
Documente Profesional
Documente Cultură
TC1 2
TC1 2
e a b a b
SLS: Pseudocod:
START
{
à a, b read a,b;
e=(a+b)*(a-b);
e=(a+b)*(a-b)
write e
ße }
STOP
1. Probleme rezolvate - 2
2. Să se calculeze expresia e=(a+b)/c, unde a, b și c sunt numere reale.
SLS: Pseudocod:
START {
read a,b,c;
à a, b, c if c≠0 then
{
NU DA
c≠0 e=(a+b)/c;
write e
e=(a+b)/c
}
ß “Numitor 0 !”
ße
else
write "Numitor 0!"
endif
STOP }
1. Probleme rezolvate - 3
3. Să se determine maximul dintre trei numere reale.
SLS: Pseudocod:
START
{
read a,b,c;
if a≥b then
à a, b, c if a≥c then
max=a
NU DA else
a≥b
max=c
NU DA NU DA endif
b≥c a≥c
else
max=b max=a
if b≥c then
max=c max=c
max=b
else
max=c
endif
ß max endif;
write max
STOP }
2. Alte exemple (probleme)