program lab_7; uses crt,graph; var L:array[1..20] of real; A:array[1..5,1..5] of real; k,s:real; key:char; min,min1,min2,j,i:byte; mode,driver,y:integer; begin repeat clrscr; mode:=vga; driver:=vgahi; initgraph(mode, driver,'D:\turbo\tp70\bgi'); setbkcolor(cyan); setcolor(magenta); setfillstyle(1,magenta); fillellipse(320,80,130,50); floodfill(320,80,magenta); setcolor(yellow); setfillstyle(1,yellow); fillellipse(320,230,130,50); floodfill(320,230,yellow); fillellipse(320,380,130,50); y:=80; setcolor(11); settextstyle(1,0,1); outtextxy(90,5,'3DRASTVUYTE BAC PRIBETSTVUET NAAROV ALEXEY'); outtextxy(170,450,'Priyatnogo ispolzovaniya'); settextstyle(0,0,0); setcolor(blue); outtextxy(270,70,'Massiv_I'); outtextxy(270,220,'Massiv_II'); outtextxy(300,370,'BbIXOD'); repeat key:=readkey; case key of #72: begin setcolor(yellow); fillellipse(320,y,130,50); setfillstyle(1,yellow); floodfill(320,y,yellow); setcolor(blue); outtextxy(275,70,'MASSIV_I'); outtextxy(274,220,'MASSIV_II'); outtextxy(300,370,'BbIXOD'); if y=80 then y:=530; y:=y-150; setcolor(magenta); setfillstyle(1,magenta); fillellipse(320,y,130,50); floodfill(320,y,magenta); setcolor(blue); outtextxy(275,70,'MASSIV_I'); outtextxy(274,220,'MASSIV_II'); outtextxy(300,370,'BbIXOD'); end; #80: begin setcolor(yellow); fillellipse(320,y,130,50); setfillstyle(1,yellow); floodfill(320,y,yellow); if y=380 then y:=-70; y:=y+150; setcolor(blue); outtextxy(275,70,'MASSIV_I'); outtextxy(274,220,'MASSIV_II'); outtextxy(300,370,'BbIXOD'); setcolor(magenta); setfillstyle(1,magenta); fillellipse(320,y,130,50); floodfill(320,y,magenta); setcolor(blue); outtextxy(275,70,'MASSIV_I'); outtextxy(274,220,'MASSIV_II'); outtextxy(300,370,'BbIXOD'); end; #13: begin if y=80 then begin closegraph; textbackground(cyan); clrscr; textcolor(black); gotoxy(15,10); writeln('DaH MACCuB L[1..20], 3ameHuTb eJIEMEHTbI IIosJIe min, '); gotoxy(15,11); writeln(' na srednee arifmeticheskoe vsego ryada '); gotoxy(30,25); textcolor(128+red); writeln('HA}|{MuTE JIIO6yIO klaBuWy DLYA prodol}|{eniya!!!'); readkey; clrscr; min := 1; s := 0; for i:=1 to 20 do begin gotoxy(2,2); textcolor(black); writeln('BbeDite element massiva ',i); textcolor(magenta); gotoxy(7,2+i); writeln('i='); textcolor(white); gotoxy(10,2+i); readln(L[i]); if L[i] < L[min] then min := i; s := s + L[i]; end; s:=s/20; for i:=1 to 20 do begin if i > min then L[i] := s; gotoxy(45,2); textcolor(black); writeln('Polucheniy Massiv'); textcolor(magenta); gotoxy(48,2+i); writeln('i= '); textcolor(blue); gotoxy(50,2+i); writeln(L[i]:4:2); end; gotoxy(35,25); textcolor(128+red); writeln('Hagmite lubuu klavishu dlya vihoda V menu!!!'); readkey; end; if y=230 then begin closegraph; textbackground(cyan); clrscr; textcolor(black); gotoxy(15,10); writeln('V matrice naiti min element, pazdelit elementy stroki '); gotoxy(15,11); writeln('v kotoroy on nahoditsya,na naydenniy min element '); gotoxy(30,25); textcolor(128+red); writeln('HA}|{MuTE JIIO6yIO klaBuWy DLYA prodol}|{eniya!!!'); readkey; clrscr; min1:=1; min2:=1; for i:=1 to 5 do for j:=1 to 5 do begin textcolor(magenta); gotoxy(6,4); writeln('BbeDite element massiva ',i,'x',j); gotoxy(4+j*5,8+i); textcolor(black); readln(A[i,j]); if A[i,j] < A[min1,min2] then begin min1:=i; min2:=j; A[min1,min2]:=A[i,j]; end; end; gotoxy(2,20); writeln('min= ' ,A[min1,min2]:4:0); textcolor(128+yellow); gotoxy(1,19); writeln('============='); gotoxy(1,21); writeln('============='); k:=A[min1,min2]; textcolor(magenta); gotoxy(45,4); write('poluchen massiv '); for i := 1 to 5 do for j := 1 to 5 do begin if i=min1 then A[i,j]:=A[i,j]/k; gotoxy(35+j*5, 8+i); textcolor(black); write(A[i, j] :4 :0); end; gotoxy(30,24); textcolor(128+red); writeln('Hagmite lubuu klavishu dlya vihoda V menu!!!'); readkey; end; if y=380 then exit; end; end; until key=#13; until key=#27; end.