Показать сообщение отдельно
Старый 04.06.2010, 14:56   #2 (permalink)
darkdragon
Member
 
Регистрация: 08.04.2010
Сообщений: 38
Сказал(а) спасибо: 0
Поблагодарили 0 раз(а) в 0 сообщениях
Репутация: 10
По умолчанию

procedure redact;
label 1;
var j:integer;
begin
1:window(27,3,80,25);

assign(f,'d:spisok.dat');
for i:=1 to 25 do begin
gotoxy(1+i,2);
write(#196);
end;
gotoxy(1+i,2);
write(#191);
p:=i;
for i:=1 to 11 do begin
gotoxy(p+1,i+2);
write(#179);
end;
gotoxy(p+1,i+2);
write(#217);
y:=i;
for i:=25 downto 2 do begin
gotoxy(n+i,y+2);
write(#196);
end;
p:=n+i;
gotoxy(2,2);
write(#218);
for i:=1 to 11 do begin
gotoxy(2,2+i);
write(#179);
end;
for i:=1 to 25 do begin
gotoxy(1+i,4);
write(#196);
end;
gotoxy(p,y+2);
write(#192);
gotoxy(2,4);
write(#195);
gotoxy(26,4);
write(#180);
textcolor(3);
gotoxy(5,3);
write('Poisk i red-nie');
kod:=' ';
i:=0;
y:=5;
while kod<>#13 do begin
gotoxy(4,5); if i=0 then textcolor(2) else textcolor(15); write('po gruppe');
gotoxy(4,6); if i=1 then textcolor(2) else textcolor(15); write('po kol-vu');
gotoxy(4,7); if i=2 then textcolor(2) else textcolor(15); write('po kol-vy 5');
gotoxy(4,8); if i=3 then textcolor(2) else textcolor(15); write('redactirovat');
gotoxy(4,9); if i=4 then textcolor(2) else textcolor(15); write('Nazad');
gotoxy(3,i+5);
kod:=readkey;
if kod=#0 then begin
gotoxy(1,y+2+i);
textcolor(4);
kod:=readkey;
if kod=#72 then
if i=0 then i:=4 else i:=i-1;
if kod=#80 then
if i=4 then i:=0 else i:=i+1;
textcolor(4);
gotoxy(1,y+1+i);
end;
end;
if i=0 then begin
reset(f);
if eof(f) then begin window(3,16,80,25); close(f);
textcolor(2);
writeln('fail ne sozdan');
readln;
clrscr;
textcolor(15);
goto 1;
end else begin
window(3,16,80,25);
clrscr;
writeln('vvedite gruppu');
readln(grup);
clrscr;
gotoxy(1,1);
textcolor(2);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
reset(f);
p:=1;
textcolor(15);
while not(eof(f)) do begin
read(f,dan);
if dan.group=grup then begin
pos:=filepos(f);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
end;
end;
end;
readln;
close(f);
clrscr;
goto 1; end
else
if i=1 then begin
reset(f);
if eof(f) then begin window(3,16,80,25); close(f);
textcolor(2);
writeln('fail ne sozdan');
readln;
clrscr;
textcolor(15);
goto 1;
end else begin
window(3,16,80,25);
clrscr;
writeln('vvedite kolvo studentov');
readln(j);
clrscr;
textcolor(2);
gotoxy(1,1);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
reset(f);
p:=1;
textcolor(15);
while not(eof(f)) do begin
read(f,dan);
if dan.kst=j then begin
pos:=filepos(f);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
end;
end;
end;
close(f);
readln;
clrscr;
goto 1;
end else if i=2 then begin
reset(f);
if eof(f) then begin window(3,16,80,25); close(f);
textcolor(2);
writeln('fail ne sozdan');
readln;
textcolor(15);
goto 1;
end else begin
window(3,16,80,25);
clrscr;
writeln('vvedite kol-vo 5');
readln(j);
clrscr;
reset(f);
textcolor(2);
gotoxy(1,1);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
p:=1;
textcolor(15);
while not(eof(f)) do begin
read(f,dan);
if dan.oc5=j then begin
pos:=filepos(f);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
end;
end;
end;
close(f);
readln;
clrscr;
goto 1;
end
else if i=3 then begin
reset(f);
if eof(f) then begin window(3,16,80,25); close(f);
textcolor(2);
writeln('fail ne sozdan');
readln;
clrscr;
textcolor(15);
goto 1;
end else begin
window(3,16,80,25);
clrscr;
reset(f);
gotoxy(1,1);
textcolor(2);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
reset(f);
p:=1;
textcolor(15);
while not eof(f) do begin
read(f,dan);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
end;
close(f);
textcolor(9);
writeln('vvedite gruppu kotoruiu nujno otredactirovat');
textcolor(15);
readln(grup);
reset(f);
textcolor(2);
gotoxy(1,1);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
reset(f);
p:=1;
textcolor(15);
while not(eof(f)) do begin
read(f,dan);
if dan.group=grup then begin
pos:=filepos(f);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
gotoxy(1,dan.kolvo+4);
textcolor(9);
writeln('redactirovat? 1-da,2-net');
textcolor(15);
readln(r);
if r=1 then begin
writeln('vvedite nazvanie gruppi');
readln(dan.group);
repeat
writeln('vvedite kolvo studentov');
readln(dan.kst);
writeln('vvedite kolvo ocenok');
write('2- ');
readln(dan.oc2);
write('3- ');
readln(dan.oc3);
write('4- ');
readln(dan.oc4);
write('5- ');
readln(dan.oc5);
until dan.kst=(dan.oc2+dan.oc3+dan.oc4+dan.oc5);
dan.srball:=(dan.oc2*2+dan.oc3*3+dan.oc4*4+dan.oc5 *5)/(dan.kst);
end else if r=2 then begin clrscr; goto 1; end;
textcolor(2);
gotoxy(1,1);
write('gruppa');
gotoxy (15,1);
write('kol-vo stud-v');
gotoxy (35,1);
write('2-k');
gotoxy(40,1);
write('3-k');
gotoxy(45,1);
write('4-k');
gotoxy(50,1);
write('5-k');
gotoxy(55,1);
writeln('srednii ball');
reset(f);
p:=2;
textcolor(9);
seek(f,pos-1);
clrscr;
writeln('otredactirovanno');
write(f,dan);
seek(f,pos-1);
read(f,dan);
textcolor(2);
gotoxy(1,2);
write('gruppa');
gotoxy (15,2);
write('kol-vo stud-v');
gotoxy (35,2);
write('2-k');
gotoxy(40,2);
write('3-k');
gotoxy(45,2);
write('4-k');
gotoxy(50,2);
write('5-k');
gotoxy(55,2);
writeln('srednii ball');
textcolor(15);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
seek(f,0);
p:=5;
textcolor(9);
writeln('otredaktirovannii spisok');
textcolor(2);
gotoxy(1,5);
write('gruppa');
gotoxy (15,5);
write('kol-vo stud-v');
gotoxy (35,5);
write('2-k');
gotoxy(40,5);
write('3-k');
gotoxy(45,5);
write('4-k');
gotoxy(50,5);
write('5-k');
gotoxy(55,5);
writeln('srednii ball');
textcolor(15);
while not(eof(f)) do begin
read(f,dan);
gotoxy(1,1+p);
write(dan.group);
gotoxy(21,1+p);
write(dan.kst);
gotoxy(36,1+p);
write(dan.oc2);
gotoxy(41,1+p);
write(dan.oc3);
gotoxy(46,1+p);
write(dan.oc4);
gotoxy(51,1+p);
write(dan.oc5);
gotoxy(60,1+p);
writeln(dan.srball:1:1);
p:=p+1;
end;
close(f);
readln;
clrscr;
goto 1;
end else clrscr;
end;
end;
end; if i=4 then textcolor(15);
end;
procedure dobavl;
begin
window(29,3,80,25);
clrscr;
assign(f,'d:spisok.dat');
reset(f);
while not eof(f) do begin
read(f,dan);
pos:=filepos(f);
end;
write('Vvedite gruppu: ');
with dan do begin
readln(group);
repeat
writeln('vvedite kol-vo studentov');
readln(kst);
writeln('vvedite kol-vo ocenok');
write('2- ');
readln(oc2);
write('3- ');
readln(oc3);
write('4- ');
readln(oc4);
write('5- ');
readln(oc5);
until kst=(oc2+oc3+oc4+oc5);
srball:=(oc2*2+oc3*3+oc4*4+oc5*5)/kst;
kolvo:=kolvo+1;
seek(f,pos);
write(f,dan);
end;
close(f);
end;
darkdragon вне форума   Ответить с цитированием
Ads

Яндекс

Member
 
Регистрация: 31.10.2006
Сообщений: 40200
Записей в дневнике: 0
Сказал(а) спасибо: 0
Поблагодарили 0 раз(а) в 0 сообщениях
Репутация: 55070