1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
| program menu15;
uses crt;
const
NORMAL=$2;
SELECT=$4;
N=3;
K=7;
var
menu:array [1..K] of string[20];
punkt:integer;
ch:char;
x,y:integer;
gd,gm:integer;
{--------— 1 PROGRAMM —--------}
procedure first_programm;
begin
clrscr;
writeln('FIRST PROGRAMM IS OPENED.');
readln;
var a1, b1, c1, d1,
a2, b2, c2, d2,
a3, b3, c3, d3,
x1, x2, x3: real;
begin
clrscr;
a1:=1.6; b1:=0.12; c1:=0.57; d1:=0.18;
a2:=0.3800; b2:=0.25; c2:=-54; d2:=0.63;
a3:=0.28; b3:=0.46; c3:=-1.12; d3:=0.88;
b2:=b1+b2*(-a1/a2); c2:=c1+c2*(-a1/a2); d2:=d1+d2*(-a1/a2);
b3:=b1+b3*(-a1/a3); c3:=c1+c3*(-a1/a3); d3:=d1+d3*(-a1/a3);
c3:=c3+c2*(-b3/b2); d3:=d3+d2*(-b3/b2);
x3:=d3/c3;
x2:=(d2-c2*x3)/b2;
x1:=(d1-b1*x2-c1*x3)/a1;
writeln (' СЛУ');
writeln (' ');
writeln ('№15. 1,6+0,12+0,57=0,18;');
writeln ( ' 0,38+0,25-54=0,63;');
writeln (' 0,28+0,46-1,12=0,88;');
writeln (' ');
writeln('Корни системы:');
write('x1=',x1:0:2,' x2=',x2:0:2,' x3=',x3:0:2);
readln;
end;
end;
{--------— 2 PROGRAMM —--------}
procedure second_programm;
begin
clrscr;
writeln('SECOND PROGRAMM IS OPENED.');
readln;
end;
{--------— 3 PROGRAMM —--------}
procedure third_programm;
begin
clrscr;
writeln('THIRD PROGRAMM IS OPENED.');
readln;
end;
{--------— 4 PROGRAMM —--------}
procedure fourth_programm;
begin
clrscr;
writeln('FOURTH PROGRAMM IS OPENNED.');
readln;
end;
{--------— 5 PROGRAMM —--------}
procedure fifth_programm;
begin
clrscr;
writeln('FIFTH PROGRAMM IS OPENED.');
readln;
end;
{--------— 6 PROGRAMM —--------}
procedure sixth_programm;
begin
clrscr;
writeln('SIXTH PROGRAMM IS OPENED.');
readln;
end;
{--------— MENU TO SCREEN 1----------}
procedure menutoscreen;
var i:integer;
begin
clrscr;
for i:=1 to K do
begin
gotoxy(x,y+i-1);
write(menu[i]);
end;
TextColor(Red);
gotoxy(x,y+punkt-1);
TextBackGround(LightGray);
end;
{--------— MAIN PROGRAMM —--------}
begin
menu[1]:=' Метод Гаусса ';
menu[2]:=' Метод кв. корней ';
menu[3]:=' Метод Крамера ';
menu[4]:=' Матрица ';
menu[5]:=' Схема Горнера ';
menu[6]:=' И т.д ';
menu[7]:=' EXIT ';
punkt:=1;
x:=5; y:=5; TextBackGround(LightGray);
menutoscreen;
repeat
ch:=readkey;
if ch=char(0) then begin
ch:=readkey;
case ch of
char(80):
if punkt<K then
begin
gotoxy(x,y+punkt-1);
write('',menu[punkt],' ');
punkt:=punkt+1;
TextColor(Red);
gotoxy(x,y+punkt-1);
write('> ',menu[punkt],' ');
TextBackGround(LightGray);
gotoxy(3,y+punkt-1);
end;
char(72):
if punkt>1 then
begin
gotoxy(x,y+punkt-1);
write('',menu[punkt],' ');
punkt:=punkt-1;
TextColor(Red);
gotoxy(x,y+punkt-1);
write('> ',menu[punkt],' ');
TextBackGround (LightGray);
end;
end;
end
else if ch=chr(13) then
begin
case punkt of
1:first_programm;
2:second_programm;
3:third_programm;
4:fourth_programm;
5:fifth_programm;
6:sixth_programm;
7:ch:=chr(27);
end;
menutoscreen;
end;
until ch=chr(27);
end. |