program feleles_hianyzok_nelkul; var t:text; i,j,k,n,m,p,x:integer; cs: string; a,h,o:array [1..30] of string; begin writeln('Teljes nevsor:'); assign(t,'nevsor.txt'); reset(t); i:=0; while not eof(t) do begin inc(i); readln(t,a[i]); writeln(i:2,'. ',a[i]); end; n:=i; assign(t,'hianyzok.txt'); reset(t); i:=0; while not eof(t) do begin inc(i); readln(t,h[i]); //writeln(i:2,'. ',h[i]); end; m:=i; for i:=1 to m-1 do for j:=i+1 to m do if a[i]>a[j] then begin cs:=a[i]; a[i]:=a[j]; a[j]:=cs; end; writeln; writeln('Hianyzok nevsora:'); for i:=1 to m do writeln(i:2,'. ',h[i]); writeln; writeln('Oran jelenlevok nevsora:'); k:=0; for i:=1 to n do begin //Keressuk azt az a[i]-t, ami nincs a h tombben. j:=1; while (j<=m)and(a[i]<>h[j])do inc(j); if j>m then begin k:=k+1; o[k]:=a[i]; end; end; p:=k;//p-az o[] tomb elemeinek szama for i:=1 to p do writeln(i:2,'. ',o[i]); randomize; x:=1+random(p); writeln; writeln('Felelo: ',o[x]); readln; end.