ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 19.09.2024

Просмотров: 21

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

write('#');

gotoxy(3,1);

write ('Prizvyshe');

gotoxy (21,1);

write('Vik');

gotoxy(29,1);

write('Stat`');

gotoxy(42,1);

write ('Gorod');

gotoxy(51,1);

write('Diagnoz');

for i:=1 to filesize(f) do

begin

if (i)mod(2)=0 then textcolor(red) else textcolor(green);

read(f,z);

gotoxy(1,i+1);

write(i);

gotoxy(3,i+1); write(z.pri);

gotoxy(22,i+1); write(z.vik);

gotoxy(30,i+1); write(z.stat);

gotoxy(42,i+1); write(z.gorod);

gotoxy(52,i+1); write(z.diagnoz);

writeln;

end;

textcolor(white);

close(f);

reset(f);

writeln('Ukazhite nomer udalyaemoi zapisi: ');

readln(n);

if filesize(f)<n then

begin

gotoxy(20,10);

write('Oshibka!!');

end else

begin

assign(f1,'PACIENTU2.DAT');

reset(f);

rewrite(f1);

for i:=1 to filesize(f) do

begin

read(f, z);

if filepos(f)<>n then write (f1,z);

end;

close(f1);close(f);

erase(f); rename (f1,'pac.dat');

gotoxy(20,wherey);

write('Zapis udalena');

textcolor(white);

end;

end;

readln;

end;

procedure Redakt;

begin

clrscr;

textcolor(white);

assign(f,'pac.dat');

reset(f);

if filesize(f)=0 then

begin

gotoxy(20,10);

write('SpUsok pust! Zapovnit fail!');

end

else

write('#');

gotoxy(3,1);

write ('Prizvyshe');gotoxy (21,1);

write('Vik');gotoxy(29,1);

write('Stat`');

gotoxy(42,1);

write ('Gorod');

gotoxy(51,1);

write('Diagnoz');

for i:=1 to filesize(f) do

begin

if (i)mod(2)=0 then textcolor(red) else textcolor(green);

read(f,z);

gotoxy(1,i+1);

write(i);

gotoxy(3,i+1); write(z.pri);

gotoxy(22,i+1); write(z.vik);

gotoxy(30,i+1); write(z.stat);

gotoxy(42,i+1); write(z.gorod);

gotoxy(52,i+1); write(z.diagnoz);

writeln; end;

textcolor(white);

close(f);

reset(f);

write('Vvedit` nomer zapysu dlya zminy ');

readln(n);

if n>filesize(f) then

begin

textbackground(8);

clrscr;

gotoxy(38,12); write('Oshibka!');


end else

begin

if n=i then

read(f,z);

seek(f,n-1);

writeln('Vvedit` potribni danni');

gotoxy(20,wherey);

write('Vvedit` familiy: '); readln(z.pri);

gotoxy(20,wherey);

write('Vvedit` vik: '); readln(z.vik);

gotoxy(20,wherey);

write('Vvedit` stat: '); readln(z.stat);

gotoxy(20,wherey);

write('Vvedit` gorod: '); readln(z.gorod);

gotoxy(20,wherey);

write('Vvedit` diagnoz: '); readln(z.diagnoz);

write(f, z);write('Zminy zberegeni!');

end;

readln;

close(f);

end;

procedure Poisk;

begin

clrscr;

assign(f,'pac.dat');

write('Vvedit` diagnoz: '); readln(n_diagn);

k:=0; reset(f);

writeln;

while not (eof(f)) do

begin

read(f, z);

if n_diagn=z.diagnoz then k:=k+1

end;

close(f); reset(f);

if k=0 then begin write('Takogo diagnozu nema'); readkey end

else

begin

clrscr;

write('#');

gotoxy(3,1);

write ('Prizvyshe');

gotoxy (21,1);

write('Vik');

gotoxy(29,1);

write('Stat`');

gotoxy(42,1);

write ('Gorod');

gotoxy(51,1);

write('Diagnoz');

writeln;

end ; begin

while not (eof(f)) do

begin

read(f, z);

if n_diagn=z.diagnoz

then begin

if (i)mod(2)=0 then textcolor(red) else textcolor(green);

gotoxy(1,wherey);

write(i);

gotoxy(3,wherey); write(z.pri);

gotoxy(22,wherey); write(z.vik);

gotoxy(30,wherey); write(z.stat);

gotoxy(42,wherey); write(z.gorod);

gotoxy(52,wherey); write(z.diagnoz);

writeln;

end; end;

close(f);

end;

reset(f);

i:=0;

while not (eof(f)) do

begin

read(f,z);

if (z.gorod<>'Sumy') then i:=i+1;

end;

writeln('Kilkist` nemiscevyh hvoryh =',i);

readkey ;

textcolor(white);

end;

procedure Poisk2;

begin

clrscr;

assign(f,'pac.dat');

write('Vvedit` diagnoz: '); readln(n_diagn);

writeln('Vvedit` vik: '); readln(v_vik);

i:=1; k:=0;

reset(f);

writeln;

clrscr;while not (eof(f)) do

begin


read(f, z);

if n_diagn=z.diagnoz then

begin

write('#');

gotoxy(3,1);

write ('Prizvyshe');

gotoxy (21,1);

write('Vik');

gotoxy(29,1);

write('Stat`');

gotoxy(42,1);

write ('Gorod');

gotoxy(51,1);

write('Diagnoz');

writeln;

if (v_vik=z.vik) then

begin

gotoxy(1,wherey);

write(i);

gotoxy(3,wherey); write(z.pri);

gotoxy(22,wherey); write(z.vik);

gotoxy(30,wherey); write(z.stat);

gotoxy(42,wherey); write(z.gorod);

gotoxy(52,wherey); write(z.diagnoz);

writeln;

i:=i+1;

end; end else

k:=1;

end;

if (k=1) and (i=1) then begin clrscr; write('nety takogo!'); end;

close(f);

readkey ;

textcolor(white);

end;

end.


Додаток в (Обов’язковий) Лістинг модуля Graf

unit graf;

interface

uses Graph, Init;

procedure start;

procedure final;

implementation

procedure start;

begin

mygraphinit;

setbkcolor(8);

setcolor(2);

settextstyle(7,horizdir,6);

outtextxy(85,150,'Kursova robota');

settextstyle(7,horizdir,2);

outtextxy(180,215,'studenta 210-ik grupy');

outtextxy(210,240,'Krykunova Igora');

outtextxy(250,265,'variant 15');

setcolor(4);

line(10,10,10,200); line(10,10,200,10);

line(20,20,20,150); line(20,20,150,20);

line(629,10,429,10); line(629,10,629,210);

line(619,20,469,20); line(619,20,619,150);

line(10,450,10,250); line(10,450,210,450);

line(20,440,20,300); line(20,440,170,440);

line(629,450,629,250); line(629,450,429,450);

line(619,440,619,300); line(619,440,469,440);

readln; closegraph; end;

procedure final;

begin

mygraphinit;

setbkcolor(8);

setcolor(2);

settextstyle(7,horizdir,5);

outtextxy(175,175,'Robota bude');

outtextxy(175,245,'zavershena!');

setcolor(4);

line(10,10,10,200); line(10,10,200,10);

line(20,20,20,150); line(20,20,150,20);

line(629,10,429,10); line(629,10,629,210);

line(619,20,469,20); line(619,20,619,150);

line(10,450,10,250); line(10,450,210,450);

line(20,440,20,300); line(20,440,170,440);

line(629,450,629,250); line(629,450,429,450);

line(619,440,619,300); line(619,440,469,440);

readln;

closegraph;

end;

end.