a)
a=25 n=6
i=1; a=25+1=26;
i=2; a=26-4=22;
i=3; a=22+9=31;
i=4; a=31-16=15;
i=5; a=15+25=40
i=6; a=40-36=4;
Raspuns:4
b)
a=18; n=?
i=1; a=18+1=19;
i=2; a=19-4=15;
i=3; a=15+9=24;
i=4; a=24-16=8;
Raspuns:4
c)
citeste a,n
(numere naturale)
i←1
cat timp i≤n executa
daca i%2=0 atunci
a←a-i*i
altfel
a←a+i*i
sf. daca
i←i+1
sf. cat timp
scrie a