!!! ATENŢIE !!!

Aceste rezolvări NU au fost aprobate de
MINISTERUL EDUCAŢIEI sau altă comisie
recunoscută de Ministerul Educaţiei. În consecinţă
nimeni nu îşi asumă răspunderea pentru eventualele
greşeli şi / sau perderi survenite în urma folosirii lor!
Foloseşte rezolvările pe riscul tău !!!

Dacă găseşti greşeli sau ai nelămuriri în legătură cu o anumită
rezolvare trimite-mi un e-mail pe adresa raducu@trei.ro şi voi
încerca să lămuresc / corectez problema.

Rezolvări Subiectul II
2
----------------------------------------------------------Varianta 1:
1. c

2. d

3. v1:=A.x-B.x;
v2:=A.y-B.y;
d:=sqrt(v1*v1+v2*v2);
write(’ d= ’,d);
4. Nodul cu cei mai mulţi fii este 6
Frunzele arborelui sunt nodurile: 1 2 3 8
5. var i, j, n, m:integer;
a:array[1..10,1..10]of integer;
begin
write(' n= '); read(n);
write(' m= '); read(m);
for i:=1 to n do
for j:=1 to m do
if i<j
then a[i,j]:=i
else a[i,j]:=j;
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:3);
writeln;
end;
end.
─────────────────────────────────────────────────────────
Varianta 2:
1. a
4.

if

2. c

3. 5 si 2

a[k,j] mod 2 = 1
then s := s + a[k,j];

5. var i:integer;
cuv:string[21];
begin
write(' cuvantul: '); readln(cuv);
for i:=1 to length(cuv) do
cuv[i]:=upcase(cuv[i]);
write(cuv);
end.
─────────────────────────────────────────────────────────
Varianta 3:
1. b

2. c

4. elene

Rezolvări Subiectul II
3
----------------------------------------------------------3. f.x:=f1.x*f2.y+f1.y*f2.x;
f.y:=f1.y*f2.y;
5. var n,i,j:integer;
a:array[1..10,1..10]of integer;
begin
write(' n= '); read(n);
for i:=1 to n do
for j:=1 to n do
begin
a[i,j]:=n-j+1;
if (i=j)
then a[i,j]:=0;
end;
for i:=1 to n do
begin
for j:=1 to n do
write(a[i,j]:4);
writeln;
end;
end.
─────────────────────────────────────────────────────────
Varianta 4:
1. b

2. a

4. if (s[i]>=’a’) and (s[i]<=’z’)
then s[i]:=’W’;
5. var n,i,j:integer;
a:array[1..10,1..10]of integer;
begin
write(' n= '); read(n);
for i:=1 to n do
for j:=1 to n do
begin
a[i,j]:=n-i+1;
if (i+j=n+1)
then a[i,j]:=0;
end;
for i:=1 to n do
begin
for j:=1 to n do
write(a[i,j]:4);
writeln;
end;
end.

3.

2
1

Rezolvări Subiectul II
4
----------------------------------------------------------Varianta 5:
1. b

2. d

3. 14 frunze

4. if s[i]=c
then s[i]:=d;
5. var n,m,i,j:integer;
a:array[1..10,1..10]of integer;
begin
write(' n= '); read(n);
write(' m= '); read(m);
for i:=1 to n do
for j:=1 to m do
begin
if (i<j)
then a[i,j]:=j
else a[i,j]:=i;
end;
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:4);
writeln;
end;
end.
─────────────────────────────────────────────────────────
Varianta 6:
1. a

2. c

3. 14 muchii

5. var i:integer;
s:string;
begin
write(' textul: '); readln(s);
for i:=2 to length(s) do
if (s[i-1]=' ') and (s[i]<>' ')
then s[i]:=upcase(s[i]);
if s[1]<>' ' then s[1]:=upcase(s[i]);
write(s);
end.
Varianta 7:
1. a
3. write(x.nume,’ ’);
write(x.clasa,’ ’);
write(x.media);
4. 2 muchii

2. d

4. 16

Rezolvări Subiectul II
5
----------------------------------------------------------5. var i:integer;
c:char;
s:string;
begin
write(' textul: '); readln(s);
for i:=1 to length(s) do
if (s[i]<>'a') and (s[i]<>'e') and (s[i]<>'i') and (s[i]<>'o') and (s[i]<>'u')
then c:=s[i];
write(' ultima consoana: ',c);
end.
─────────────────────────────────────────────────────────
Varianta 8:
1. c

2. a

3. abefgh 6

4. 3

5. var n, p, i, j, k:integer;
a:array[1..10,1..10] of integer;
begin
write(' n= '); read(n);
write(' p= '); read(p);
k:=-1;
for i:=1 to n do
for j:=1 to p do
begin
k:=k+2;
a[i,j]:=k*k;
end;
for i:=1 to n do
begin
for j:=1 to p do
write(a[i,j]:4);
writeln;
end;
end.
─────────────────────────────────────────────────────────
Varianta 9:
1. c

2. a

3. abcdea

5. var n,i,j,s:integer;
a:array[1..10,1..10]of integer;
begin
write(' n= '); read(n);
for i:=1 to n do
for j:=1 to n do
begin
write(' A[',i,',',j,']= ');
read(a[i,j]);

4. 5

.1.1.1].j. for i:=1 to n do for j:=1 to p do begin k:=k+2.j]:4).i. for i:=2 to n-1 do write(a[i. k:=-2. begin write(' n= '). s:=0.. ───────────────────────────────────────────────────────── Varianta 10: 1. for i:=n downto 1 do write(a[n. end. for i:=1 to n do begin for j:=1 to p do write(a[i. d 3. ───────────────────────────────────────────────────────── Varianta 11: 1. write(' p= ').'. read(p).i..'. read(n).p.10. a[i. 3081 5.min:integer.' '). for i:=1 to m do for j:=1 to n do begin write(' A['.']= ').' '). c 3. a:array[1. 3 4.10] of integer. var n.i]. write(' n= ').k:integer.10] of integer.j]:=k*k.Rezolvări Subiectul II 6 ----------------------------------------------------------end.. a 2. a 2.i. end.m.10.j. for i:=n-1 downto 2 do write(a[i. begin write(' m= '). 11 brcdbr 5. read(m). var n.n].j. 4. end. writeln.' '). a:array[1.' ').i]. 64 . for i:=1 to n do write(a[1. read(n). end.

1].Rezolvări Subiectul II 7 ----------------------------------------------------------read(a[i. for i:=1 to n do begin for j:=1 to n do write(a[i. var n.1. for i:=1 to m do begin min:=a[i. for i:=1 to n do for j:=1 to n do if i+j=n+1 then a[i. end. nota1.j] then min:=a[i. pret:real.j]). c 2. 11 AbcdEfghOId 3. var m:record nume:string[30].' ').j]:=0 else if i+j<n+1 then a[i. end.j]:4). end..j:integer. ───────────────────────────────────────────────────────── Varianta 12: 1. end. nota3:integer. b 3.i. nota2. end..10. read(n). ───────────────────────────────────────────────────────── Varianta 13: 1. end. write(min. 5. 4. begin write(' n= '). writeln. end.j]:=n-j+1.10]of integer. 11 bcdfghd . a 4.j]:=i else a[i. for j:=2 to n do if min>a[i. var e:record nume:string[30]. a:array[1.j]. b 2.

end.i.. begin write(' n= '). ───────────────────────────────────────────────────────── Varianta 14: 1. for j:=1 to 4 do begin for i:=1 to 4 do a[i. end. c 2.j]:4). a:array[1.j]:=1 else a[i. n:=n div 10. read(n).. 9 2 4. ───────────────────────────────────────────────────────── Varianta 15: 1. begin write(' n= '). d 4. b 2.1. bemeut . end..Rezolvări Subiectul II 8 ----------------------------------------------------------5.j]:=2.1.j]:2). writeln. a:array[1. for i:=1 to n do begin for j:=1 to n do write(a[i. for i:=1 to n do for j:=1 to n do if i+j=n+1 then a[i.j]:=0 else if i+j<n+1 then a[i.j:integer. c 3. end. end. 2 3 4 6 5.10..j]:=n mod 10.i. for i:=1 to 4 do begin for j:=1 to 4 do write(a[i. writeln. var n.10]of integer. read(n).4. var n.4]of integer. Gradul minim este: 2 Nodurile cu gradul minim sunt: 5 7 8 3.j:integer.

end. a 2.50]of integer. read(n). for i:=1 to 5 do begin for j:=1 to 5 do write(a[i. for i:=1 to n do begin for j:=1 to n do write(a[i. var n. ───────────────────────────────────────────────────────── Varianta 17: 1.j:longint. writeln. for i:=1 to n do for j:=1 to n do if (i=j) or (i+j=n+1) then a[i. var n.Rezolvări Subiectul II 9 ----------------------------------------------------------5. a 3. end. begin write(' n= ').i. end. writeln. a:array[1..j]:=n mod 10.j]:=4 else a[i. iar în vârful stivei va ramane elementul 7 4. for i:=1 to 5 do begin for j:=1 to 5 do a[i.5.1. n:=n div 10.5]of integer.i. read(n).1. clasa a-XII-a A clasaaa 5. end. b 2. end.50. a:array[1.j]:3)..j:longint. ───────────────────────────────────────────────────────── Varianta 16: 1. Numarul minim este 2. begin write(' n= ').. b .j]:2)..j]:=3.

c 2. read(n).i.20.. end. end.j]:=i else a[i. read(n). . for i:=1 to length(a) do if (s[i]='a') or (s[i]= 'e') or (s[i]='i') or (s[i]='o') or (s[i]='u') then write(‘*’) else write(a[i]). var n.j]:3). begin write(' n= ').j]:=j.j]:=i+j-1. for i:=1 to n do begin for j:=1 to n do write(a[i. Numarul minim este 3 iar în stiva mai ramâne un element. var n. end. În vârful stivei este 2 iar in stiva sunt 3 elemente. end. a:array[1.. ───────────────────────────────────────────────────────── Varianta 18: 1. for i:=1 to n do for j:=1 to n do if i mod 2=1 then a[i. begin write(' n= ')..1..1.j:longint.20]of integer. writeln. writeln.i.20.j]:3). a:=’informatica’.Rezolvări Subiectul II 10 ----------------------------------------------------------3. for i:=1 to n do begin for j:=1 to n do write(a[i. a:array[1. 5.j:longint. for i:=1 to n do for j:=1 to n do a[i.20]of integer. 4. a 3. 4. 11 b*t 5.

20]of integer.j]:=i+j else a[i. a 2. read(n)..j]:3). for i:=1 to n do for j:=1 to n do if j mod 2=1 then a[i. 5.data_nasterii. c 3. c 3.j]:=i. var n. writeln. ev. d 2.20. var n.j]:4). a 3.j]:=i+j else a[i. ───────────────────────────────────────────────────────── Varianta 21: 1.1. begin write(' n= ')... 9 şi 7 4.j].i. 5 şi 4 5. read(n)..Rezolvări Subiectul II 11 ----------------------------------------------------------Varianta 19: 1.j:longint. 4 .j]:=a[i.20]of integer. writeln.20. for i:=length(a) downto 1 do write(a[i]). end. for i:=1 to n do for j:=1 to n do if (i=1) or (j=1) then a[i. ───────────────────────────────────────────────────────── Varianta 20: 1. end. end. a:array[1.an 4. d 2. begin write(' n= ').j:longint.1. for i:=1 to n do begin for j:=1 to n do write(a[i. end. a:=’Bac 2008 iulie’. 2008bac2008 4. a:array[1.i. for i:=1 to n do begin for j:=1 to n do write(a[i.j-1]+a[i-1.

4 5. begin write(' m= '). read(n). i:integer. lantul maxim are 3 muchii 5.. begin write(' Textul: '). 200 . a:array[1.a[m.. d 3.j]+a[i. writeln. var s:string[250]. read(m). end. var m.s[i+1]). var m. read(n).Rezolvări Subiectul II 12 ----------------------------------------------------------5.i.100. end. write('Elementul solicitat este: '. end. k:=m*n.j. ───────────────────────────────────────────────────────── Varianta 23: 1. a 3.100. write(' n= ')..j]:=k. for i:=1 to length(s)-1 do if s[i]=s[i+1] then writeln(s[i].n]).k:integer. for i:=1 to m do for j:= 1 to n do if (i=1) or(j=1) then a[i.1. b 2. ───────────────────────────────────────────────────────── Varianta 22: 1. b 2.n. write(' n= '). end. begin write(' m= ').j]:=i+j-1 else a[i.j]:=a[i-1.j-1].100]of integer. 4.j]:3). read(s). read(m).j:integer.n. 5 4.. for i:=1 to m do begin for j:=1 to n do write(a[i.1.100]of integer. a:array[1. k:=k-1. for i:=1 to m do for j:= 1 to n do begin a[i.i.

j]=0) then a[i. 4. ───────────────────────────────────────────────────────── Varianta 25: 1. delete(s. 5.Rezolvări Subiectul II 13 ----------------------------------------------------------end. readln(s2). write(' n= '). c 3. for i:=1 to n do for j:= 1 to n do begin a[i.j:integer. var m.i+1. var s1.i. for i:=1 to length(s) do if (s[i]>='0') and (s[i]<='9') then ok:=true.100. s:=copy(s1.j]:=(i+j-1) mod n. a:array[1.100]of integer. for i:=1 to m do . d 3. write(' sufixul: '.s2.j]:=n end. ok:=false. j:=length(s2). ───────────────────────────────────────────────────────── Varianta 24: 1. write(' Cuvantul 2: ').1. end. y:= sqrt(x)+1/x+abs(x).1. i. 5. c 2.s:string[100].j.s). begin write(' m= '). while (i>0) and (j>0) and (s1[i]=s2[j]) do begin i:=i-1.max:integer.n. if ok then write(' CORECT') else write(' INCORECT').p. i:=length(s1). read(n).2). end. 4. a 2... begin write(' Cuvantul 1: '). read(m). readln(s1). j:=j-1. if (a[i.length(s1)-i+1).

i. for i:= 2 to m do p:=p*a[i.p.100]of integer. for i:=1 to n do for j:= 1 to n do begin write(' A['.'.k:integer.' '). end.100.1. a:array[1. if p> max then max:=p.']= '). c 3.j] then write(p.' ')..j]).'. read(a[i.j]. end.'. read(n). for k:=1 to n do if k<>i then p:=p*a[k.j]).j]. for i:=1 to n do for j:= 1 to n do begin p:=1.j].']= '). for j:=1 to n do begin p:=a[1.'.j. read(a[i.Rezolvări Subiectul II 14 ----------------------------------------------------------for j:= 1 to n do begin write(' A['. 4 elem. ───────────────────────────────────────────────────────── Varianta 26: 1. d 2.j.. roton 5. end. 4. end. for j:=1 to n do begin p:=a[1. if p = max then write(j. end.i.j. begin write(' n= '). for i:= 2 to m do p:=p*a[i.i. var n. end. if p=a[i. end.j].j]. .

s2:=s1. for i:=1 to n do begin for j:= 1 to n do write(a[i.1). a:array[1. H. 6 3. s2:=s1. 0 5.j]:=a[i-1. for i:=1 to length(s2) do if s2[i]='a' then delete(s2.y:=F. for i:=1 to n do for j:= 1 to n do if (i=1) or (j=1) or (j=n) then a[i.y.x:=F. 3 .100. begin write(' s1= '). if s1<>s2 then writeln(s2).1). s2:=s1. for i:=1 to length(s2) do 4. if s1<>s2 then writeln(s2). end. for i:=1 to length(s2) do if s2[i]='i' then delete(s2. for i:=1 to length(s2) do if s2[i]='e' then delete(s2. i:integer.y*G.i.i. b 2. end.j]:=1 else a[i.Rezolvări Subiectul II 15 ----------------------------------------------------------Varianta 27: 1. if s1<>s2 then writeln(s2).y+F.1.x. 5.i.j:integer. read(n).100]of integer. writeln.x*G. a 2. ───────────────────────────────────────────────────────── Varianta 28: 1. H. var s1. var n. b 4...i.j]+a[i-1.j+1]. c 3.y*G.j-1]+a[i-1.1). readln(s1).j]:4). s2:=s1.s2:string[20]. begin write(' n= ').

atac 4. for i:=1 to n do 4.i. a:array[1.1).1).j:integer.'. a 3.'. for i:=1 to n do for j:= 1 to n do begin write(' A['. var n. d 3.i. 2 5. end.j. a:array[1.1. for i:=2 to n do if a[i.j] / a[1.i. read(a[i.20] of integer. var n. begin write(' n= '). a 2. if s1<>s2 then writeln(s2). for i:=1 to length(s2) do if s2[i]='u' then delete(s2.p:real.i.6. if s1<>s2 then writeln(s2). 2 3 4 5 5. write(pp:5:0. 8 .j]/a[i.']= '). for j:=1 to n do begin p:=a[1. read(n).1]. ok:=true. if (ok) and (frac(p)=0) then pp:=pp*p. begin write(' n= ').1]<>p then ok:=false. end.i.20..6]of integer.j:integer. ───────────────────────────────────────────────────────── Varianta 30: 1.' '). pp:=1.j])... c 2. end.Rezolvări Subiectul II 16 ----------------------------------------------------------if s2[i]='o' then delete(s2.1. end.. read(n). pp. ───────────────────────────────────────────────────────── Varianta 29: 1. s2:=s1. ok:boolean.

. . c 2.1].20] of integer.j-1]+a[i-1.Rezolvări Subiectul II 17 ----------------------------------------------------------for j:=1 to n do if (i=1) or (j=1) then a[i. end. type masina=record marca:string[20].s:integer.i]. for i:=9 downto 2 do s:=s+a[i. for i:=1 to 7 do s:=s+a[1.j]:4).i. end.1.j]:=a[i. write(' s= '.20. a:array[1.'. b 3. end.j]:=1 else a[i. s:=0. writeln.'. for i:=2 to 9 do s:=s+a[i. varf 6 11 varf 200 100 6 11 5. var i.']= '). begin for i:=1 to 10 do for j:=1 to 7 do begin write(' a['.7].i].j. for i:=1 to n do begin for j:=1 to n do write(a[i. read(a[i. 4. end.j].j]).s). for i:=7 downto 1 do s:=s+a[10.j.. end. ───────────────────────────────────────────────────────── Varianta 31: 1. anul_fabricatiei:integer.

lit:array[0. var s:string[255].. b 4. writeln(s). 9 8 7 6 5 9 8 7 6 5 2. var c1. ───────────────────────────────────────────────────────── Varianta 33: 1. write(' c2= '). end. raza:real end.40]of byte. end. 8 9 8 7 6 5 5.y:integer. 4. i:integer. readln(s). var x:cerc. c 3. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5. for i:=1 to length(s) do begin if s[i]=c1 then s[i]:=c2 else if s[i]=c2 then s[i]:=c1. begin write(' s= '). readln(c2). .c2:char. begin write(' c1= ').Rezolvări Subiectul II 18 ----------------------------------------------------------Varianta 32: 1. d 3. writeln(s). s:string. readln(c1). a 2. write(' s= '). c:char.cuv:integer. i. readln(s). type cerc=record x.

end. for i:=1 to n do for j:=1 to n do begin if k mod 3=0 then k:=k+2. 4. a[i.Rezolvări Subiectul II 19 ----------------------------------------------------------if s[1]=' ' then cuv:=0 else cuv:=1. c 4 4 100 4 100 200 5. for c:='B' to 'Z' do if (c <>'E')and(c <>'I')and(c <>'O')and (c <>'U') then if (lit[ord(c)-ord('A')]<>0) then write(c.1. a:array[1.k:integer.. for i:=2 to length(s) do if (s[i-1]=' ') and (s[i]<>' ') then cuv:=cuv+1. asta . b 3.' '). ───────────────────────────────────────────────────────── Varianta 34: 1. 2.j]:=k.20]of integer. end. end. for i:=1 to length(s) do if (s[i]<>' ') then inc( lit[ord(s[i])-ord('A')] ).i.cuv). writeln(' cuv= '. writeln.20. k:=k+2. begin write(' n= '). var n. end. for i:=1 to n do begin for j:=1 to n do write(a[i..j]:4). k:=0. read(n).j.

100.j.j].i.j]). write(' m= '). write(min.j]). 6 amat 4.min:integer. 171 .']= '). a:array[1.1. end.Rezolvări Subiectul II 20 ----------------------------------------------------------Varianta 35: 1.min:integer. end. var n.']= '). read(n)...i. for i:=1 to n do for j:=1 to n do begin write(' A['.j. ───────────────────────────────────────────────────────── Varianta 36: 1. Graful are 5 componente conexe. for i:=1 to n do if a[i. end.j]<min then min:=a[i.100]of integer.j.. for j:=1 to n do begin min:=a[1.100. 5.i. read(a[i. b 3.100]of integer.m. begin write(' n= ').j].1.'. a 2. read(m). read(a[i. 3 5. var n. begin write(' n= ').'.j. d 2.j]. for j:=1 to m do begin min:=a[1.'. Trebuie adaugate 4 muchii ca graful sa devina conex. for i:=1 to n do if a[i. a:array[1. for i:=1 to n do for j:=1 to m do begin write(' A['.j]<min 4. c 3. end.'.' ').i.. read(n).

2 muchii 5.' ').p. writeln(' s= '.'.'.']= ').s). ───────────────────────────────────────────────────────── Varianta 37: 1. d 2. lit:array[0..30]of integer.i. read(n). if s[length(s)]<>' ' then s[length(s)]:=upcase(s[length(s)]). if (s[i-1]<>' ') and (s[i]=' ') then s[i-1]:=upcase(s[i-1]). for i:=1 to n do for j:=1 to n do begin write(' A['. end. end. begin write(' s= ').j])..j].i. write(min. if s[1]<>' ' then s[1]:=upcase(s[1]).. var s:string[255]. 6 cicluri . d+(5)=2 1 0 0 1 0 5. read(a[i. c:char. i. 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 2. begin write(' n= '). a:array[1.40]of byte.imin:integer.j. c 3.Rezolvări Subiectul II 21 ----------------------------------------------------------then min:=a[i. readln(s). b 3. var n.j.1. ───────────────────────────────────────────────────────── Varianta 38: 1. end. d-(1)=3. a 4. end. 4.cuv:integer.30. for i:=2 to length(s) do begin if (s[i-1]=' ') and (s[i]<>' ') then s[i]:=upcase(s[i]).

i1:=i. end. if ( s[1]='a' ) or ( s[1]='e' ) or ( s[1]='i' ) or ( s[1]='o' ) or ( s[1]='u' ) then begin j:=i. for i:=0 to length(s) do if (s[i-1]=' ')and (s[i]<>' ') then if (s[i]='a') or (s[i]='e') or (s[i]='i') or (s[i]='o') or (s[i]='u') then begin j:=i. for j:=1 to n do begin imin:=1. aux:char. end. a 3. end. if a[imin. ───────────────────────────────────────────────────────── Varianta 39: 1. . i. 234 345 456 5. s[j]:=aux. for i:=1 to n do if a[i. i1:=1.p). j:=j-1. s[i1]:=s[j].j]=a[n+1-j.Rezolvări Subiectul II 22 ----------------------------------------------------------end. c 2. while i1<j do begin aux:=s[i1].j].j. begin write(' s= '). end.j] then imin:=i. p:=1. while ( s[j+1]<>' ' ) and ( j<length(s) ) do j:=j+1.j]<a[imin. 3 componente conexe 4. while (s[j+1]<>' ')and (j<length(s)) do j:=j+1. write(' p= '. read(s). i1:=i1+1.j] then p:=p*a[imin. var s:string[255].i1:integer.

4. s[i1]:=s[j].' ').s). write(' s= '. until p=0.s). write(s1.i:integer.length(s1)). end. a 3. 3 componente conexe 4. d 3. while s[i]<>'*' do begin s1:=s1+s[i].7.j]:=i+j.5. for i:=1 to n do for j:=1 to n do a[i.. begin write(' s= ').30]of integer.s). j:=j-1. begin write(' n= ').30. ───────────────────────────────────────────────────────── Varianta 41: 1. abc . s[j]:=aux. a 2. a 2. Nodurile 1. end. read(s). i1:=i1+1. a:array[1.9 sunt frunze 5. end. p. end.p. write(' s= '. i:=i+1.i. 111 122 123 5. read(n).3. repeat p:=pos(s1.j:integer. var n. i:=1.Rezolvări Subiectul II 23 ----------------------------------------------------------while i1<j do begin aux:=s[i1]. end.s1:string[255]. ───────────────────────────────────────────────────────── Varianta 40: 1.1. var s. if p>0 then delete(s..

var i. var s:string[40]. Varianta 44: 4.. writeln..32.j]:=2 else if i<j then a[i.j. a 3. a 2. read(n).' '). 7. a:array[1. for i:=1 to n do for j:=1 to n do if i=j then a[i.j]:=3. ───────────────────────────────────────────────────────── Varianta 42: 1.' '). i:integer. begin write(' s= '). 3. end. writeln.1.j]. begin write(' n= '). ───────────────────────────────────────────────────────── Varianta 43: 1. elementul a[5.' '). read(s). 5. for i:=1 to length(s) do if ( s[i]='a' ) or ( s[i]='e' ) or ( s[i]='i' ) or ( s[i]='o' ) or ( s[i]='u' ) then write(s[i].j]:=1 else a[i. end.5]=5 5. end.Rezolvări Subiectul II 24 ----------------------------------------------------------for i:=1 to n do begin for j:=1 to n do write(a[i.n:integer. for i:=1 to n do begin for j:=1 to n do write(a[i.j]. end.23]of integer. a 2. 9) 5. end. Nodul 4 – radăcină / 5 noduri frunză (1. 11 . 3 noduri 4. a 3.

───────────────────────────────────────────────────────── Varianta 46: 1. for i:=1 to length(s) do begin for j:=1 to length(s) do if i<>j then write(s[j]). a 4. 9 5. 4. end. 6. i.i. writeln.. d 3. k:=k-1. 8. end else a[i.. begin write(' s= ').23. n. 1 element . Decendenţii radăcinii: 1. read(s).j].1]=1 3. for i:=1 to n do begin for j:=1 to n do write(a[i. a[2. begin write(' n= '). read(n). fo ───────────────────────────────────────────────────────── Varianta 45: 1.23]of integer. var s:string[40]. end.k:integer. a 5. for i:=1 to n do begin k:=i. 7 5.j]:=1. 3. a 2. 6 frunze 4. end. end.1. var a:array[1.j]:=k. 6.j:integer. c 2.j.Rezolvări Subiectul II 25 ----------------------------------------------------------1. 7 / Frunze 5. writeln. 2. var s:string[100]. for j:=n downto 1 do if k>1 then begin a[i. a 2.' '). end.

100]of integer.'. begin write(' n= ').1. var n.100]of integer.100. begin write(' s= ').x*a. b 3.j].a mod k =0 and f. for i:=1 to length(s) do if ( s[i]='a' ) or ( s[i]='e' ) or ( s[i]='i' ) or ( s[i]='o' ) or ( s[i]='u' ) then s[i]:=chr( ord(s[i])+1 ).1. c 2..j:integer. end. acalaureat 4. writeln. a. for i:=1 to m1 do begin for j:=1 to n do write(b[i.j]:=a[i.' '). read(a[i. sqrt(a. for i:=1 to m do for j:=1 to n do if i mod 2=0 then b[i div 2. 1 2  6  5 (lungime 3) 4. write(' m= ').m1. for i:=1 to m do for j:=1 to n do begin write(' A['.. read(m). m1:=m div 2 + m mod 2.i. b 2. end.k. ───────────────────────────────────────────────────────── Varianta 48: 1.y) 5..x+a.'.i. a 3. write(' s= '. f.i.y*a.. end.Rezolvări Subiectul II 26 ----------------------------------------------------------i:integer.s). ───────────────────────────────────────────────────────── Varianta 47: 1. end.b mod k =0 5.j].j]).']= ').j.j:integer.b:array[1. a. begin .100. read(n).b:array[1.m. var n. read(s).

s1:string[20]. ───────────────────────────────────────────────────────── Varianta 49: 1. s1:=''. 6 noduri 4. 1 5.s1:string[100]. i:integer. i:=1.' '). read(s). r 5. function vocala(c:char):boolean. ───────────────────────────────────────────────────────── Varianta 50: 1. i:integer. var s. begin write(' s= '). a 2. end. a[i. end. c 3. begin write(' s1= '). while ( not vocala(s[i]) ) and (i<=length(s)) do .j]. d 2.Rezolvări Subiectul II 27 ----------------------------------------------------------write(' n= '). end. read(s1). read(n).med1 + x.j]:=k. var s.med2) / 2 4. end. d 3. for i:=1 to n do for j:=1 to n do begin k:=k+2. end. for i:=1 to n do begin for j:=1 to n do write(a[i. for i:=1 to length(s) do if ( s[i]='a' ) or ( s[i]='e' ) or ( s[i]='i' ) or ( s[i]='o' ) or ( s[i]='u' ) then s1:=s1+s[i]. s:=s1. begin if ( c='a' ) or ( c='e' ) or ( c='i' ) or ( c='o' ) or ( c='u' ) then vocala:=true else vocala:=false. (x. writeln.s1). write(' s1= '.

───────────────────────────────────────────────────────── Varianta 51: 1. read(s). begin write(' s= '). 5. ok:boolean. end. end. a 4. b 3 2 1 2 1 5 2 1 5. write(' s= '. read(s). if s[1]<>' ' then write(s[1]). var s:string[30]. 20 . ───────────────────────────────────────────────────────── Varianta 52: 1. for i:=2 to length(s) do if (s[i-1]=' ') and (s[i]<>' ') then write(s[i]). while ( not vocala(s[i]) ) and (i>=1) do i:=i-1. 4. i:integer. Radacina 2 iar nodurile terminale 1. if i<length(s)+1 then delete(s. 8. 3.i. begin write(' S= '). 12 4.1).1).s). if i>0 then delete(s. var s:string[100]. if ok then write(' DA ') else write(' NU '). 4 3 2 1 2. ok:=true. i:=length(s).Rezolvări Subiectul II 28 ----------------------------------------------------------i:=i+1.i. a 2. 10 5. i:integer. d 3. for i:=1 to length(s) do if ( s[i]<>' ' ) and ( ( s[i]<'a' ) or ( s[i]>'z' ) ) and ( ( s[i]<'A' ) or ( s[i]>'Z' ) ) then ok:=false.

6). a[x. end. d 2. 1. n.']= ').i]. read(x).. read(n). aux:integer. write(' n= '). 8 (insa numai primi doi sunt descendenţi directi) 5. 2. b 3. ───────────────────────────────────────────────────────── Varianta 53: 1. read(n). for i:=1 to n do begin aux:=a[x. end. Descendentii sunt 6. m. write(' x= '). write(' x= '). k2=4 5. 2 4. 7.i]:=a[y.j]. for i:=1 to n do for j:=1 to n do if i mod 2=0 4. ───────────────────────────────────────────────────────── Varianta 54: 1. begin write(' m= ').i]:=aux. a:array[1.'. var i.. read(m). writeln.20]of integer. n. read(y). var i.'. write(' y= ').20.20]of integer. end. 4. read(x).Rezolvări Subiectul II 29 ----------------------------------------------------------end. 1.20. y. a 3. x:integer. for i:=1 to m do begin for j:=1 to n do write(a[i. end.j]). 0. k1=7.j.i]. a[y. 3. j.' '). j. c 2..i. 4. 7 . read(a[i. a:array[1.. for i:=1 to m do for j:=1 to n do begin write(' A['. 1. Tata=(3. 6. begin write(' n= '). x.

d 3. begin write(' s= '). a:array[1. end.Rezolvări Subiectul II 30 ----------------------------------------------------------then a[i.s1). 8 4. c 4.s1:string[100]. writeln.j]:= x mod 10 else a[i. s1:=''. 1 2 3 2. ───────────────────────────────────────────────────────── Varianta 55: 1. 2.k. end ..j]:3). end.. read(s). a 4 2 3 4 3.1. write(' s1= '. var s.j]:=x div 10. end. read(k).25. c 2. 3. writeln. i:integer. (c>=’a’ and (c<=’z’) 5. 5. write(' k= ').i.j]:=1 else a[i. read(n). for i:=1 to n do for j:=1 to n do if j<=k then a[i.j:integer. for i:=1 to n do begin for j:=1 to n do write(a[i. ───────────────────────────────────────────────────────── Varianta 56: 1. begin write(' n= '). var n.j]:=2. for i:=1 to n do begin for j:=1 to n do write(a[i.25]of integer. for i:=1 to length(s) do if (s[i]>='0') and (s[i]<='9') then s1:=s1+s[i].j]. 2 1 2 3 4 5 5.' ').

b 3. read(n). c 5. for i:=1 to n do for j:=1 to n do if i<a then mat[i.25.. 2 4.c:integer. b 2. begin write(' s= '). c 2. readln(s). end end. 7. ───────────────────────────────────────────────────────── Varianta 58: 1. write(' c= '.25]of integer.j]:3).. end. 6.i. a 3. for i:=1 to length(s) do if (s[i]>='a') and (s[i]<='z') then c:=c+1.c). (c=’a’) or (c=’e’) or (c=’i’) or (c=’o’) or (c=’u’) 5.a. mat:array[1.j:integer. var s:string[50].1. read(a). i<>j 5. 8 4. begin write(' n= '). var s:string[50]. ───────────────────────────────────────────────────────── Varianta 59: 1. i.Rezolvări Subiectul II 31 ----------------------------------------------------------end.j]:=2. i=9 .j]:=0 else mat[i. 5 4. a 2. 3. var n.j]:=1 else if i=a then mat[i. for i:=1 to n do begin for j:=1 to n do write(mat[i. ───────────────────────────────────────────────────────── Varianta 57: 1. writeln. 1. 2. write(' a= ').

a:array[0. d 2. 75 5..40] of integer. i:=0. write(i).9] of integer. 1 4. i:=0. for i:=1 to length(s) do if (s[i]>='a') and (s[i]<='z') then a[ord(s[i])-ord('a')]:=a[ord(s[i])-ord('a')] +1. d 2. begin write(' s= '). readln(s). 99 4. ───────────────────────────────────────────────────────── Varianta 60: 1. ───────────────────────────────────────────────────────── Varianta 61: 1. i. max:=a[0]. f . c 3. for i:=0 to 40 do if max<a[i] then max:=a[i]. begin write(' s= ').max:integer. end. readln(s).. if max<>0 then begin while a[i]<max do i:=i+1. while a[i]<max do i:=i+1. end else write(' NU '). max:=0. for i:=1 to 9 do if max<a[i] then max:=a[i].max:integer. a:array[0. write(chr( i+ord('a') ) ). var s:string[50]. end. for i:=1 to length(s) do if (s[i]>='0') and (s[i]<='9') then a[ord(s[i])-ord('0')]:=a[ord(s[i])-ord('0')] +1.Rezolvări Subiectul II 32 ----------------------------------------------------------i. c 3.

k:=1. 5. for i:=n-1 downto 1 do for j:=1 to i do a[i.100]of integer. var n. ───────────────────────────────────────────────────────── Varianta 63: 1. var s:string[255]. begin write(' n= '). end. a[ord(s[i])]:=1.. for j:=1 to n do a[n. e 5.255]of integer.j:integer..Rezolvări Subiectul II 33 ----------------------------------------------------------5. for i:=1 to length(s) do if (s[i]>='a') and (s[i]<='z') and (a[ord(s[i])]=0) then begin write(s[i]. read(s).j]:3).i. read(m).’ ’. i:integer. writeln.k:integer. b 3.j.0.1. a:array[0.j]:=j. write(' m= ').j]+a[i+1. a:array[1. for i:=1 to n do begin for j:=1 to n do write(a[i. var n.' ').’ ’.s2) else write(s2. 3.i. if length(s1)<length(s2) then write(s1. begin write(' s= '). b 4.50.100. end.s1).m. 0 4. read(n). b 2.50] of integer.. a 2.j-1]+a[i+1. begin write(' n= ').j]:=a[i+1.. read(n). end.. a:array[1. ───────────────────────────────────────────────────────── Varianta 62: 1. 6 . end.j+1].

function vocala(c:char):boolean. k:=k+1. if (c='a')or(c='A')or(c='e')or(c='E')or(c='i')or(c='I')or(c='o')or(c='O')or(c='u')or(c='U') then vocala:=true. var s:string[100]. s:=' '+s.j]:=k.Rezolvări Subiectul II 34 ----------------------------------------------------------for j:=1 to m do for i:=1 to n do begin a[i.c:integer. end. for i:=1 to n do begin for j:=1 to m do write(a[i. while (s[j+1]<>' ') and (j<=n) do j:=j+1. Varianta 65: . end. ───────────────────────────────────────────────────────── Varianta 64: 1.j]:4). 3 0 0 1 1 0 5. 0 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 2. a 4. end. d 3. begin write(' s= '). begin vocala:=false. end. if vocala(s[i]) and vocala(s[j]) then c:=c+1. writeln. i. end. c:=0. for i:=2 to length(s) do if (s[i-1]=' ') and (s[i]<>' ') then begin j:=i. end. readln(s).j. write(c).

begin write(' s= '). var s:string[50]. for i:=1 to n do begin for j:=1 to m do write(a[i. a:array[1. end.j]:=k.1.i.50] of integer. read(s). end.j]:=k.k)). end. read(m). b 1 4 3 2 5 5. 3. for i:=1 to n do if i mod 2 =1 then for j:=1 to m do begin a[i. write(' m= ').50. 1 4 3 2 5 1 4 3 2 5 1 4 3 2 5 1 4 3 2 5 2... begin write(' n= '). end. 8 4.j]:4). d 3. for k:=1 to length(s) do writeln(copy(s. c 2. c 4.m. 5. k:=k+1.Rezolvări Subiectul II 35 ----------------------------------------------------------1.k:integer. read(n). f 5. 5 . var n. writeln. Varianta 67: 3.1. k:=k+1. k:integer. end else for j:=m downto 1 do begin a[i.j. k:=1. ───────────────────────────────────────────────────────── Varianta 66: 1.

j]).n).p). 3. 5) 4. a 4. . T=(0. for i:=1 to m do for j:=1 to n do begin write(' A['.50. read(a[i. c 3.i. 1 1 1 1 2. 1.j]>0) then p:=p*a[i. length() 5. end. 1.m.j. for k:=length(s) downto 1 do writeln(copy(s.i.j]. 4. var n. b 2.1. ───────────────────────────────────────────────────────── Varianta 69: 1.. begin write(' s= '). for i:=1 to n do for j:=1 to n do 4.50] of integer. k:integer. 5.k. 1. read(n). read(m). write(' n= ').length(s)-k+1)). a:array[1. for i:=1 to m do for j:=1 to n do if (i mod 2 =0) and (j mod 2= 1) and (a[i. a 3. 3. 1.1.'.Rezolvări Subiectul II 36 ----------------------------------------------------------1. p:longint.50. begin write(' n= ').j:integer.i. 2 descendenti 1 2 3 4 5. read(n). 2... read(s). d 2.. begin write(' m= '). p:=1. var n. write(' p= '. c 1 2 2 2 1 2 3 3 3. 4) 5. ok:boolean. var s:string[50].j:integer. T=(0.'. end.1.50] of integer. end. a:array[1. 2. t:=copy(s.']= '). ───────────────────────────────────────────────────────── Varianta 68: 1.

end.50. end. a 2.'. for i:=1 to m do for j:=1 to n do begin write(' A['. write(' n= '). writeln.1. for i:=x+1 to m do for j:=1 to n do a[i-1. read(n).j. if ok then write(' Este triunghiulara superior') else write(' Nu este trunghiulara superior'). d 3.'. read(a[i. m:=m-1. a:array[1.i.j. ok:=true. write(s[length(s)]).j]:6). d . end. begin write(' m= ').j]:=a[i. T=(2. ───────────────────────────────────────────────────────── Varianta 71: 1. end.j]. 5. 2.i. read(a[i.'. var n.']= ')..j.x:integer.j]>0) then ok:=false. end.. read(x).j]). 2) 4.j]). for i:=1 to m do begin for j:=1 to n do write(a[i.'.50] of integer.i. write(' x= '). for i:=2 to n do for j:=1 to i-1 do if (a[i. c 2.Rezolvări Subiectul II 37 ----------------------------------------------------------begin write(' A['. 5.']= '). 0. read(m). ───────────────────────────────────────────────────────── Varianta 70: 1.m.

i]. end. end.k:integer. for i:=1 to n do for j:=1 to n-i+1 do begin k:=k+1.n-i+1].1. 4. for j:=n downto 2 do for i:=n downto n-j+1 do begin k:=k+1.i.100]of integer.j]:4). a:array[1. 1 arc . readln(e1. s1:=s1+a[i. 4.nota) else write(e2.j.100]of integer..1. a[i. conexe 5. 5.nota then write(e1. readln(e1.nota). if e1. k:=0. end. begin write(' n= '). readln(e2. a[i.Rezolvări Subiectul II 38 ----------------------------------------------------------3.nota). readln(e2. k:=0. a[i. read(n). writeln.nume). for j:=1 to n do for i:=1 to n do begin k:=k+1. k:=0. read(n).nume).j]:=k.k:integer.nota).j]:=k. var n.j]:=k. c 2.100.100. a:array[1.. var n. begin write(' n= ')..nota>=e2. 3 comp. ───────────────────────────────────────────────────────── Varianta 72: 1. for i:=1 to n do begin for j:=1 to n do write(a[i. end. a 3.j.i.. s2:=s2+a[i.

nc. var n. a[p. 3.i:integer. begin . if (s[i]='a') or (s[i]='e') or (s[i]='i') or (s[i]='o') or (s[i]='u') then nv:=nv+1. 5. for i:=1 to n do begin for j:=1 to n do write(a[i. nc:=0. b 2. for i:=2 to length(s) do if (s[i-1]=' ') and (s[i]<>' ') then begin nc:=nc+1. ───────────────────────────────────────────────────────── Varianta 73: 1.Rezolvări Subiectul II 39 ----------------------------------------------------------end.j]:3). C=(1. j.2. 5. end. end. readln(s).1.j:integer. end.nv).i.100. var s:string.. a:array[1.' '.j]:=a[q. a) 2 muchii b) o muchie 5.nv.. 7) 4.j]. a) 4. begin write(' S= '). 2 arce. 4. nv:=0. end. c 3. 9 b) 5 noduri (1. write(nc. 6.j]:=aux.1) 4. a[q. a 2. ───────────────────────────────────────────────────────── Varianta 74: 1.3. s:=' '+s. for j:=1 to n do begin aux:=a[p. d 3.j]. end.100]of integer.aux:integer.4. writeln.

3. a 3.100.. for i:=1 to n do for j:=1 to n do if i mod 2=0 then a[i. ───────────────────────────────────────────────────────── Varianta 75: 1.1. end. for i:=0 to length(s) div 2 do begin .i. 3) 5. 3) şi (4. 6.m. b 2. ELIM. 7. read(n).j]:=1. ADD 5.j:integer.100]of integer.. write(' n= ').j]:=0 else a[i. writeln.j]:4). var n. begin write(' S= '). 6. a:array[1.Rezolvări Subiectul II 40 ----------------------------------------------------------write(' n= '). T=(5. read(n).j]:=n-j+1 else a[i. for i:=1 to m do begin for j:=1 to n do write(a[i. d 4. 0. 2. writeln.j]:3). for i:=1 to m do for j:=1 to n do if (i-1) div 2 mod 2=0 then a[i. read(m). 2 4. d 3. ───────────────────────────────────────────────────────── Varianta 76: 1. end. for i:=1 to n do begin for j:=1 to n do write(a[i. var s:string[20]. readln(s). end.j]:=j. 1) ) 5.j:integer. i. 2 arce ( arcul (2. begin write(' m= '). end. 6.

while (j<length(c)) and (ok) do begin if c[j]<>s[i+j-1] then ok:=false. 3 4. a 2. end.c:string. for i:=2 to length(s) do if (s[i-1]=' ') and (s[i]<>' ') then s[i]:=chr( ord(s[i])-ord('a')+ord('A') ). gasire:=0. exit. end. var t. var i.x:string[100]. 4 5. i:integer. end.1). p:integer. ok:boolean. delete(s. write(' s= '. j:=1. end. begin write(' S= '). s:=' '+s. j:=j+1. ───────────────────────────────────────────────────────── Varianta 77: 1.j:integer. end. function gasire(s.Rezolvări Subiectul II 41 ----------------------------------------------------------for j:=i+1 to length(s)-i do write(s[j]).1.s). c:string[15]. if ok then begin gasire:=i. 2 4. readln(s). end. 5 5. ind:integer):integer. b 3. c 2. begin for i:=ind to length(s) do if (s[i]=c[1]) then begin ok:=true. var s:string[51]. c 3. ───────────────────────────────────────────────────────── Varianta 78: 1. . end. writeln.

6. a 2. p:=1. i:integer. ───────────────────────────────────────────────────────── Varianta 79: 1.length(s)). 5. readln(c). 5.1.i)+'*'+copy(s. T=(1.p).length(t)). 4. 0.1. d 2. i:=1.c. var s:string. 2) 5.i+1. write(' t= '. 3 . write(' cuvantul: ').p-1)+'?'+copy(t. a 4. 6 4. 4. readln(s).t). begin if (c='A') or (c='E') or (c='I') or (c='O') or (c='U') then vocala:=true else vocala:=false. 9. c 3. 6. 3. 2. end. repeat p:=gasire(t. end. function vocala(c:char):boolean. i:=i+1. readln(t).Rezolvări Subiectul II 42 ----------------------------------------------------------begin write(' textul: '). ───────────────────────────────────────────────────────── Varianta 80: 1. end. 6. write(s). while i<length(s) do begin if vocala(upcase(s[i])) then s:=copy(s. if p<>0 then begin while (t[p]<>' ') and ( p<length(t) ) do p:=p+1. end. end. t:=copy(t. 5 muchii 3. until p=0. begin write(' s= '). 2. 4.p.

if a[i.s).m.aux:integer. var n.100. a 3.imax. if (length(cuv) mod 2=0) then write(cuv[length(cuv) div 2]. aux:char.j]<a[imin. for i:=1 to length(s) div 2 do begin j:=length(s) div 2 + length(s) mod 2 + i.j.imin. end.cuv[length(cuv) div 2+1] else write(cuv[length(cuv) div 2 +1]).j.jmax. i. 5.jmax] . imin:=1.i. 4. jmin:=j. end.. c 2. imax:=1.1. readln(s).j]>a[imax. write(' m= ').100]of integer. aux:=s[i].Rezolvări Subiectul II 43 ----------------------------------------------------------5.'. a:=a-b. b:=a-b. read(a[i. read(m).jmin] then begin imin:=i. a:=a+b. jmax:=1. ───────────────────────────────────────────────────────── Varianta 81: 1.j:integer. end. a:array[1.'.jmin.']= '). s[i]:=s[j]. end. var s:string. s[j]:=aux.i. read(n). jmin:=1.j]).. for i:=1 to n do for j:=1 to m do begin write(' A['. begin write(' s= '). for i:=1 to n do for j:=1 to m do begin if a[i. begin write(' n= '). write(' s= '.

imax.i. var n. a:array[1.1..']= ').imax].100.imin]:=a[imax. for i:=1 to n do begin for j:=1 to n do write(a[i.aux:integer. a[imin. end. jmax:=j.i]<a[imin. writeln. end.j]:4). imin:=1. end. noduri cu grad impar: 2 5. tarta . a[imax. end. end.i.'.imax]:=aux.. begin write(' n= ').j]).imin] then imin:=i. for i:=1 to n do begin if a[i.100]of integer. aux:=a[imin. for i:=1 to n do begin for j:=1 to m do write(a[i. aux:=a[imin.Rezolvări Subiectul II 44 ----------------------------------------------------------then begin imax:=i. a[imin. read(a[i. c 2.j. 3.jmax]. read(n). ───────────────────────────────────────────────────────── Varianta 82: 1. c 4.j]:4). end. a[imax.imin.i]>a[imax. noduri cu grad par: 2.jmin].imin]. imax:=1.j.imax] then imax:=i. for i:=1 to n do for j:=1 to n do begin write(' A['.'.jmin]:=a[imax. if a[i.jmax]:=aux.

imin:=1.n+1-imax]. . read(a[i.100.n+1-imax] then imax:=i. 0 1 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 1 2. for i:=1 to length(cuv) do if (cuv[i]=’a’) or (cuv[i]=’e’) or (cuv[i]=’i’) or (cuv[i]=’o’) or (cuv[i]=’u’) then write(cuv[i]).1.j.i.n+1-imin] then imin:=i. if a[i. a:array[1. 5. ───────────────────────────────────────────────────────── Varianta 83: 1.aux:integer.. d 3. writeln. begin write(' n= ').imin. end.100]of integer.j]). end. read(n). for i:=1 to n do for j:=1 to n do begin write(' A['.j. end.n+1-imax]:=aux.n+1-imin]:=a[imax. a 0 0 0 1 0 4. for i:=1 to n do begin for j:=1 to n do write(a[i.j]:4). for i:=1 to n do begin if a[i. aux:=a[imin. end. imax:=1.'. a[imin. end.imax.i..']= '). end.Rezolvări Subiectul II 45 ----------------------------------------------------------writeln.'.n+1-i]>a[imax. a[imax.n+1-imin]. var n.n+1-i]<a[imin.

ok:boolean. a 3.salariu).j]). read(a[i. ok:=false. write(a[1.3]*a[4. end.. for i:=1 to n do if a[i.’ ’.prenume). 4. readln(p.j.j:integer.i] mod 2=0 then begin ok:=true.1. begin write(' n= ').']= '). . for i:=1 to n do for j:=1 to n do begin write(' A['. 5. readln(p.i.100]of integer.b.1.el.'. read(a[i. for i:=1 to n do for j:=1 to n do begin write(' A['. begin write(' n= ')..4]).j. end.nume.2]*a[3. el.']= ').Rezolvări Subiectul II 46 ----------------------------------------------------------Varianta 84: 1.j]). write(el. 4..mediabac). p:longint.j:integer.100.'. a:array[1.c:array[1.. a.'. read(n).i.’ ’. end.i. ok:boolean. readln(p.prenume. a 2. p:longint. a 2. var n.p) else write(' IMPOSIBIL ').'. var n.i. end. 5.i]. if ok then write(' p= '. b 3.10]of integer.10. read(n).1]*a[2. p:=p*a[i. write(chr(ord(c)+1). p:=1. ───────────────────────────────────────────────────────── Varianta 85: 1.nume).

j]:=a[i.. for i:=1 to n do for j:=1 to n do if i<j then c[i.j]<b[i. end.j]:=b[i.'.i1. d 3. i1:=1.20.i. end. end else begin i2:=i1-4*n+1. 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 2. 7 .1. for i:=1 to n do begin for j:=1 to n do write(c[i. a 0 0 1 0 0 0 0 0 1 0 0 0 5. ───────────────────────────────────────────────────────── Varianta 86: 1.j]:4). i1:=i1+2.j]).j] then c[i.j]:=a[i. var n. for j:=2*n downto 1 do begin 4. end. begin write(' n= ').']= ').j.20]of integer.j]:=i1.j] else c[i.j]:=b[i.j] else if i>j then c[i.j] else if a[i.i2:integer.i.Rezolvări Subiectul II 47 ----------------------------------------------------------for i:=1 to n do for j:=1 to n do begin write(' B['.'.. for i:=1 to 2*n do if i mod 2 =1 then for j:=1 to 2*n do begin a[i. read(b[i. writeln.j].j. read(n). a:array[1.

end. read(n). 3.1.j]:4).i. end.20] of integer.1. begin write(' n= ').j.s. begin write(' n= '). 45 5. end. 4.. 24 . read(n).20.20. nr:=nr+1.']= '). 1.20] of integer..j]:=i2. var a:array[1. 6 5.i. nr:=0.n. for i:=1 to n do for j:=1 to n do begin write(' A['.j. for i:=2 to n do for j:=1 to i-1 do if a[i. a 2.'. ───────────────────────────────────────────────────────── Varianta 88: 1.nr:integer. b 3.Rezolvări Subiectul II 48 ----------------------------------------------------------a[i.n. i. i.j.'.(s/nr):5:2).s. for i:=1 to n do for j:=1 to n do begin write(' A['.j]>0 then begin s:=s+a[i. ───────────────────────────────────────────────────────── Varianta 87: 1. write(' MA= '. end.j. end. for i:=1 to 2*n do begin for j:=1 to 2*n do write(a[i. end.j]).. 5. var a:array[1. d 2.']= ').'. end. b 3. 2 4. s:=0.nr:integer. 4. i2:=i2+2.. read(a[i.'.j]. writeln.

nr:=0. begin write(' n= ').a.6] of integer. end. for i:=1 to n-1 do for j:=i+1 to n do if a[i.c. end. c:=a+b.b:integer. c:=a+b. for i:=1 to n do if i mod 2=1 then for j:=1 to n do begin T[i.j]. 28 . end. s:=0. for i:=1 to n do begin for j:=1 to n do write(T[i. a:=b.(s/nr):5:2). end else for j:=n downto 1 do begin T[i.j]>0 then begin s:=s+a[i. write(' MA= '. ───────────────────────────────────────────────────────── Varianta 89: 1. b:=c. a:=1.Rezolvări Subiectul II 49 ----------------------------------------------------------read(a[i. d 3. b:=c.j]:4). i. read(n). nr:=nr+1. var T:array[1.j.n.6.j]:=b. 4.j]:=b.1. b:=0.j]). a 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5.. a:=b. end.. 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 1 1 0 0 1 0 0 0 0 0 2.

m1-m2:5:2). m1. b 3.20] of integer.. var a:array[1. write(' M1-M2= '.']= '). nr2:=nr2+1. begin write(' n= ').i.. end. nr:=nr+1.1.j.1.nr2:integer.n. a 2.20. 10 5. end. ───────────────────────────────────────────────────────── Varianta 90: 1. iarba .s2.. m1:= s / nr.'.50] of integer.j. for i:=1 to n do for j:=1 to n do begin write(' A['. nr:=0. i. ind. m2:= s2 / nr2. read(a[i.m2:real.Rezolvări Subiectul II 50 ----------------------------------------------------------writeln. var a:array[1. max:integer.'. 2.j]>0 then begin s:=s+a[i.j]). begin write(' n= ').. j. end.j]. 1 4. v0. s2:=0. s:=0. 4.nr.j]. a 3.s. for i:=2 to n do for j:=1 to i-1 do if a[i. end. read(n). m. i.j]>0 then begin s2:=s2+a[i. 3 5. b 2. n. for i:=1 to n-1 do for j:=i+1 to n do if a[i. read(n).50. end. ───────────────────────────────────────────────────────── Varianta 91: 1. end. nr2:=0.

jmin:=j. write(' n= '). n.y = v.'.']= '). jmin:=1. ───────────────────────────────────────────────────────── Varianta 92: 1. for i:=1 to n do begin v0:=0. for i:=1 to n do for j:=1 to m do begin write(' A['.j]>0 then v0:=v0+1. end.extremitate. if v0>max then begin max:=v0. ind:=i. max:integer.'. 3.j.'.'. j. imin:=1.j]). read(m).origine. i. end..50.1.jmin] then begin imin:=i. jmin.x ) and ( v.Rezolvări Subiectul II 51 ----------------------------------------------------------write(' m= '). 6.j]).origine. var a:array[1. read(a[i. for j:=1 to m do if a[i.50] of integer. 0. imin. ( v. read(a[i. write(' Ind= '.i. ind:=0.ind). m. b 3. for i:=1 to m do for j:=1 to n do if a[i. end.j. end.x = v. for i:=1 to m do for j:=1 to n do begin write(' A['. end.i.extremitate.']= '). read(m). end. 1. begin write(' m= '). read(n). b 2. max:=0.j]<a[imin. for i:=1 to m do for j:=jmin+1 to n do . 1) 4.y ) 5.. (3.

s2:string[200]. begin s:=''. end. function sablon(x:string):string. n:=n-1. 5. var sa1. readln(s2). b 4. 1 4. 2 5. sa1:=sablon(s1). writeln. ───────────────────────────────────────────────────────── Varianta 94: 1. begin write(' s1= '). 0) . 5. i:integer. end. 5 2. d 2.j]. for i:=1 to m do begin for j:=1 to n do write(a[i. for i:=1 to length(x) do if (x[i]='a') or (x[i]='e') or (x[i]='i') or (x[i]='o') or (x[i]='u') then s:=s+'*' else s:=s+'#'. m:=m-1. var s:string. 1: 2 2: 3. for j:=1 to n do for i:=imin+1 to m do a[i-1. readln(s1). (3. sablon:=s.j].j-1]:=a[i.Rezolvări Subiectul II 52 ----------------------------------------------------------a[i.j]:=a[i.sa2. sa2:=sablon(s2).j]. for i:=1 to length(sa1) do if sa1[i]=sa2[i] then write(sa1[i]) else write('?'). ───────────────────────────────────────────────────────── Varianta 93: 1. write(' s2= '). end. 5.s1. b 3. a 3.' '). end.

3 6. (2 . 8 2. (4. arcele: (1.5) 4. write(' s= '. a .s). end. 2). (2 . write(' s= '.j:=i. (4. 6. begin write(' s= '). readln(s). 5 4: 3 5: 4 5. b 2. 4.1)+'. while s[i]=' ' do i:=i+1.j:integer. (2.s). 4). (2. (3.j-1). i. 5.j:=i. 4. 4). d 3. 3). 1: 2: 3: 4: 5: 6: 7: 8: 2 1 8 5.Rezolvări Subiectul II 53 ----------------------------------------------------------3: 1. 2).i. d 3. var s:string[20].1.5) 7 7 7 6 5. s:=copy(s. lungime:5 4. ───────────────────────────────────────────────────────── Varianta 96: 1. 2). i:=pos(' '. i:=pos(' '. begin write(' s= ').i. readln(s). '+copy(s.s). ───────────────────────────────────────────────────────── Varianta 95: 1. s:=copy(s. 2).length(s))+' '+copy(s. i. (1. (3. while s[i]=' ' do i:=i+1. 5.j-1). var s:string[20].s). 1: 2 2: 1 3: 4.1. end. 4. 3).j:integer.

m.i. var a:array[1.1. read(m). readln(n). read(n).'. s:=p+' '+n.j].j.50. end.j]). end. read(a[i.aux:integer.j]. a 3. write(' prenume= '). write(' m= ').Rezolvări Subiectul II 54 ----------------------------------------------------------4: 5: 6: 7: 8: 3. begin write(' n= '). write(' s= '.s). 5 4.']= '). writeln.j]:=a[n-i+1. 7 6 3 5. ───────────────────────────────────────────────────────── Varianta 97: 1. s:string[40]. for i:=1 to n do for j:=1 to m do begin write(' A['. end. .p:string[20]. readln(p). for j:=1 to m do for i:=1 to n div 2 do begin aux:=a[i.j.j]. begin write(' nume= ').j]:=aux.. 6 5. TITA 6 3 1 4 3 1 4 3 1 4 3 1 5. for i:=1 to n do begin for j:=1 to m do write(a[i. a[n-i+1. c 4.' '). n. 2.50]of integer. var n. a[i.'..i.

50]of integer. for i:=1 to n do for j:=1 to n do begin a[i. b 3. 1. end.. for i:=1 to n do begin for j:=1 to n do write(a[i.50. k:=0. readln(x. readln(x. k:=k+2.Rezolvări Subiectul II 55 ----------------------------------------------------------end. 5. type COLET=record pret. end.i. 1. nume_oras:string[30]. 3 5 3 5 4 3 5 4 6 . greutate:real. ───────────────────────────────────────────────────────── Varianta 99: 1.k:integer. ───────────────────────────────────────────────────────── Varianta 98: 1. (0. end.j].pret)..nume_oras). var x:COLET. read(n). readln(x.greutate). 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 2. 2) 4. var a:array[1.j]:=k.' '). writeln.j. begin write(' n= '). n. a 1 0 0 0 0 4.1. a 3. end. b 2. end.

3 5. a 3. var a:array[1. read(n). end. d 2. begin write(' n= '). for i:=1 to n do begin for j:=1 to n do write(a[i. a[n+2..j]<a[i.j].m. for i:=1 to n do for j:=1 to n do if i>j then a[i. 6 4.j]<a[i-1.j+1]) then write(a[i... end. writeln. read(a[i. 4.j.'. end.j]).. var a:array[1. for i:=2 to n+1 do for j:=2 to n+1 do if (a[i. for i:=2 to n+1 do for j:=2 to n+1 do begin write(' A['.j-1]) and (a[i.j]. n. ───────────────────────────────────────────────────────── Varianta 100: 1.j]) and (a[i. n. end.102]of longint.i]:=maxlongint. 2. a[i.. read(n).1.j]) and (a[i.i]:=maxlongint.50.i-1.j]<a[i+1.1. for i:=1 to n+2 do begin a[1.1]:=maxlongint.102.j:integer.j]:=j.. begin write(' n= ').j-1.Rezolvări Subiectul II 56 ----------------------------------------------------------5.' ').aux:integer..50]of integer. end.n+2]:=maxlongint..' '). a[i.'.']= ').i.j]:=i else a[i.j]<a[i. ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡ .i.

Sign up to vote on this title
UsefulNot useful