кароч если кому надо, то вот
Код
uses crt;
type spisok=record
f,name,o,spe:string[10];
zp:integer;
end;
mas=array[1..100] of spisok;
var a,f:mas;
y,t,w,i:integer;
procedure vvod;
var l:char;
begin
clrscr;
repeat
t:=t+1;
write('0|0aMuJlu9|='); readln(a[t].f);
write('Um9l='); readln(a[t].name);
write('oT4ecTBo='); readln(a[t].o);
write('CneL|uaJlbnocTb='); readln(a[t].spe);
write('3apnJlaTa='); readln(a[t].zp);
writeln('Prodolzit?(Y/N)');
readln(l);
clrscr;
until (l='n') or(l='N');
end;
procedure show;
var s:integer;
begin
if t=0 then writeln('baza pusta')
else
begin
writeln('|--------------------------------------------------------------------|');
write ('|ь| 0|0aMuJlu9| | Um9l | oT4ecTBo');
writeln(' |CneL|uaJlbnocTb|3apnJlaTa|');
writeln('|-|--------------|----------|--------------|---------------|---------|');
for s:=1 to t do
begin
write('|',s:1,'|');
write(a[s].f:14,'|');
write(a[s].name:10,'|');
write(a[s].o:14,'|');
write(a[s].spe:15,'|');
write(a[s].zp:8,' |');
writeln;
end;
writeln('|--------------------------------------------------------------------|');
readln;
end;
end;
procedure poisk;
var
sf:string;
b,e,d,s:integer;
begin
for s:=1 to t do
begin
if a[s].zp<5000 then
begin
write('|',a[s].f:10,'|');
write(a[s].name:10,'|');
write(a[s].o:10,'|');
write(a[s].zp:6,'|');
writeln;
d:=d+1;
end;
end;
if d=0 then writeln('Takoj familii net!!!');
readln;
end;
procedure sort;
{begin
for w:=1 to 3 do begin
for i:=1 to 2 do begin
if a[i].surname>a[i+1].surname then
f[i]:=a[i];
a[i]:=a[i+1];
a[i+1]:=f[i];
end;
end;
show;}
var
c:spisok;
h,m:integer;
begin
show;
m:=1;
while m<>t do
begin
h:=m+1;
while (h>1) and (a[h].zp < a[h-1].zp) do
begin
c.f:=a[h].f;
c.name:=a[h].name;
c.o:=a[h].o;
c.spe:=a[h].spe;
c.zp:=a[h].zp;
a[h].f:=a[h-1].f;
a[h].name:=a[h-1].name;
a[h].o:=a[h-1].o;
a[h].spe:=a[h-1].spe;
a[h].zp:=a[h-1].zp;
a[h-1].f:=c.f;
a[h-1].name:=c.name;
a[h-1].o:=c.o;
a[h-1].spe:=c.spe;
a[h-1].zp:=c.zp;
h:=h-1;
end;
m:=m+1;
end;
writeln;
show;
end;
Begin
clrscr;
t:=2;
with a[1] do
begin
f:='Ivanov';
name:='Ivan';
o:='Ivanovi4';
spe:='programmer';
zp:=6000;
end;
with a[2] do
begin
f:='Petrov';
name:='Petop';
o:='Petrovich';
spe:='ofis plankton';
zp:=7000;
end;
repeat clrscr;
writeln('1-vvod');
writeln('2-vivod');
writeln('3-vivod po vozrastu');
writeln('4-sortirovka');
writeln('0-quit');
readln(y);
clrscr;
case y of
1:vvod;
2:show;
3:poisk;
4:sort;
end;
until y=0;
end.