-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dfm
228 lines (227 loc) · 6.95 KB
/
main.dfm
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
object frmMain: TfrmMain
Left = 0
Top = 0
BorderStyle = bsSingle
Caption = #1052#1077#1090#1088#1080#1082#1072' '#1089#1087#1077#1085#1072' '
ClientHeight = 487
ClientWidth = 895
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object lblCountOfStrings: TLabel
Left = 608
Top = 8
Width = 56
Height = 16
Caption = #1057#1090#1088#1086#1082': '
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = [fsBold]
ParentFont = False
end
object lblCountOfAllSymbols: TLabel
Left = 608
Top = 24
Width = 80
Height = 16
Caption = #1057#1080#1084#1074#1086#1083#1086#1074': '
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = [fsBold]
ParentFont = False
end
object lblCountSymbols: TLabel
Left = 608
Top = 38
Width = 184
Height = 16
Caption = #1053#1077#1087#1088#1086#1073#1077#1083#1100#1085#1099#1093' '#1089#1080#1084#1074#1086#1083#1086#1074': '
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = [fsBold]
ParentFont = False
end
object lblSpenResult: TLabel
Left = 607
Top = 375
Width = 96
Height = 16
Caption = #1054#1073#1097#1080#1081' '#1089#1087#1077#1085' ='
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = [fsBold]
ParentFont = False
end
object mmoCode: TMemo
Left = 8
Top = 8
Width = 578
Height = 465
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = []
Lines.Strings = (
'<?php'
'/* 4x + 7y + 2z = 34 | 3x + 1y + 5z = 21 '
'| 8x + 2y + 6z = 52 */'
' $matrix[0] = array(4, 7, 2); '
' $matrix[1] = array(3, 1, 5); '
' $matrix[2] = array(8, 2, 6); '
' $b[0] = 34; '
' $b[1] = 21; '
' $b[2] = 52; '
' // '#1056#1077#1096#1072#1077#1084' '#1091#1088#1072#1074#1085#1077#1085#1080#1077' '
' list(list($x, $y, $z)) = gaussj($matrix, $b);'
' echo "'#1056#1077#1096#1077#1085#1080#1077'<br />"; '
' echo "X = $x<br />"; '
' echo "Y = $y<br />"; '
' echo "Z = $z<br />"; '
' // '#1055#1088#1086#1074#1077#1088#1082#1072' '
' echo 4 * $x + 7 * $y + 2 * $z; '
' echo "<br>"; '
' echo 3 * $x + 1 * $y + 5 * $z; '
' echo "<br>"; '
' echo 8 * $x + 2 * $y + 6 * $z;'
' // '#1056#1077#1096#1077#1085#1080#1077' '#1089#1080#1089#1090#1077#1084#1099' '#1083#1080#1085#1077#1081#1085#1099#1093' '#1091#1088#1072#1074#1085#1077#1085#1080#1081
' // '#1084#1077#1090#1086#1076#1086#1084' '#1052#1077#1090#1086#1076' '#1043#1072#1091#1089#1089#1072'-'#1046#1086#1088#1076#1072#1085#1072#9
' function gaussj($a, $b)'
' {'
'global $x ; global $matrix; global $b;'
'$GLOBALS['#39'x'#39'];$GLOBALS['#39'y'#39'];$GLOBALS['#39'z'#39'];'
'$_SESSION['#39'tovar'#39'];'
'$_SESSION['#39'y'#39'];'
'$_SESSION['#39'b'#39'];'
'$_SESSION['#39'b'#39'];'
'$_SESSION['#39'r'#39'];'
' $n = count($a);'
' for($j = 0; $j < $n; $j++)'
' {'
' $ipiv[$j] = 0;'
' }'
' for($i = 0; $i < $n; $i++)'
' {'
' $big = 0;'
' for($j = 0; $j < $n; $j++)'
' {'
' if($ipiv[$j] != 1)'
' {'
' for($k = 0; $k < $n; $k++)'
' {'
' if($ipiv[$k] == 0)'
' {'
' if(abs($a[$j][$k]) >= $big)'
' {'
' $big = abs($a[$j][$k]);'
' $irow = $j;'
' $icol = $k;'
' }'
' }'
' else if($ipiv[$k] > 1)'
' {'
' return "'#1052#1072#1090#1088#1080#1094#1072' '#1089#1080#1085#1075#1091#1083#1103#1088#1085#1072'";'
' }'
' }'
' }'
' }'
' $ipiv[$icol] = $ipiv[$icol] + 1;'
' if ($irow != $icol)'
' {'
' for($l = 0; $l < $n; $l++)'
' {'
' $dum = $a[$irow][$l];'
' $a[$irow][$l] = $a[$icol][$l];'
' $a[$icol][$l] = $dum;'
' }'
' $dum = $b[$irow];'
' $b[$irow] = $b[$icol];'
' $b[$icol] = $dum;'
' }'
' $indxr[$i] = $irow;'
' $indxc[$i] = $icol;'
' if($a[$icol][$icol] == 0) return "'#1052#1072#1090#1088#1080#1094#1072' '#1089#1080#1085#1075#1091#1083#1103#1088#1085#1072'";'
' $pivinv = 1 / $a[$icol][$icol];'
' $a[$icol][$icol] = 1;'
' for($l = 0; $l < $n; $l++) $a[$icol][$l] = $a[$icol][$l] *' +
' $pivinv;'
' $b[$icol] = $b[$icol] * $pivinv;'
' for($ll = 0; $ll < $n; $ll++)'
' {'
' if($ll != $icol)'
' {'
' $dum = $a[$ll][$icol];'
' $a[$ll][$icol] = 0;'
' for($l = 0; $l < $n; $l++)'
' {'
' $a[$ll][$l] = $a[$ll][$l] - $a[$icol][$l] * $dum;'
' }'
' $b[$ll] = $b[$ll] - $b[$icol] * $dum;'
' }'
' }'
' }'
' for($l = $n -1; $l >= 0; $l--)'
' {'
' if($indxr[$l] != $indxc[$l])'
' {'
' for($k = 1; $k < $n; $k++)'
' {'
' $dum = $a[$k][$indxr[$l]];'
' $a[$k][$indxr[$l]] = $a[$k][$indxc[$l]];'
' $a[$k][$indxc[$l]] = $dum;'
' }'
' }'
' }'
' // $b - '#1088#1077#1096#1077#1085#1080#1077' '#1091#1088#1072#1074#1085#1077#1085#1080#1103
' // $a - '#1086#1073#1088#1072#1090#1085#1072#1103' '#1084#1072#1090#1088#1080#1094#1072
' return array($b, $a);'
' }'
'?>')
ParentFont = False
ScrollBars = ssBoth
TabOrder = 0
WordWrap = False
OnChange = mmoCodeChange
end
object btnStart: TButton
Left = 608
Top = 440
Width = 273
Height = 33
Caption = #1042#1099#1095#1080#1089#1083#1080#1090#1100
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Courier New'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
OnClick = btnStartClick
end
object strngrdResult: TStringGrid
Left = 607
Top = 60
Width = 280
Height = 309
ColCount = 2
DefaultColWidth = 128
FixedCols = 0
TabOrder = 2
end
end