,  , Delphi

 
 
Naura
0 / 0 / 0
: 11.09.2014
: 4
#1

: Missing operator or semicolon - Delphi

14.12.2014, 22:01. 577. 6
( )

, Missing operator or semicolon

Delphi
1
  memo2.Text:=CPlayfair(st,key);
0
? .
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
14.12.2014, 22:01
: Missing operator or semicolon (Delphi):

: Missing operator or semicolon
procedure TForm9.FormShow(Sender: TObject); begin cbb1.Clear; qry1.First;...

- Missing operator or semicolon
, ? Unit1.pas(67): E2066 Missing...

: Missing operator or semicolon
. ...

: Missing operator or semicolon
, missing operator or semicolon....

: Missing operator or semicolon
Unit5.pas(82): Missing operator or semicolon unit Unit5; interface ...

: Missing operator or semicolon
, . ";" , ...

6
Sergio Leone
2462 / 1107 / 579
: 07.06.2014
: 3,259
14.12.2014, 22:05 #2
, CPlayfair.
0
Naura
0 / 0 / 0
: 11.09.2014
: 4
14.12.2014, 22:09  [] #3
, CPlayfair
Delphi
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ActnList, StdCtrls, ExtCtrls, Grids;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Button2: TButton;
    Button3: TButton;
    Memo1: TMemo;
    Label3: TLabel;
    ComboBox1: TComboBox;
    clr: TCheckBox;
    RadioGroup1: TRadioGroup;
    Button4: TButton;
    Button6: TButton;
    Button5: TButton;
    OpenDialog1: TOpenDialog;
    SaveDialog1: TSaveDialog;
    Crypto: TActionList;
    Atbash: TAction;
    ECezar: TAction;
    DCezar: TAction;
    clear: TAction;
    change: TAction;
    Memo3: TMemo;
    StringGrid1: TStringGrid;
    CPlayfair: TAction;
    DePlayfair: TAction;
    Memo4: TMemo;
    Label4: TLabel;
    Memo2: TMemo;
    procedure Button4Click(Sender: TObject);
    procedure ECezarExecute(Sender: TObject);
    procedure DCezarExecute(Sender: TObject);
    procedure clearExecute(Sender: TObject);
    procedure changeExecute(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure CPlayfairExecute(Sender: TObject);
    procedure DePlayfairExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
    rot:string  ;
 
implementation
 
{$R *.dfm}
//-------------------------Øèôðîâ**èå Ïëýéôåð*----------------------------------
function CPlayfair(s,key:string):string;
const
//-----------------Ð*çìåð êëþ÷åâîé ì*òðèöû:-------------------------------------
  MaxX = 8;//ñòðîêè
  MaxY = 4;//ñòîëáöû
  //Í*ø *ëô*âèò. Ð*çìåð äîëæå* áûòü MaxY*MaxX.
  //Ïîýòîìó â **øåì ñëó÷*å óáð**û áóêâ* "¸"
  URusA = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß';
 
var i,j,t,x1,x2,y1,y2 :integer;
    M : array[1..MaxY,1..MaxX]of Char; //êëþ÷åâ*ÿ ì*òðèö*
    rot,temp :string;
 
//---Ôó*êöèÿ ïîèñê* ñèìâîë* "ñ" â êëþ÷åâîé ì*òðèöå.-----------------------------
  //Âîçâð*ù*åò ñòðîêó "y" è ñòîëáåö "x".
  Procedure SimbolPos(c:char;var x,y:integer);
  var i,j:integer;
  begin
  x:=0;
  y:=0;
  for i := 1 to MaxY do
    for j := 1 to MaxX do
      if c=M[i,j] then
        begin
        x:=j;
        y:=i;
        exit;
        end;
  end;
 
label M1;
begin
//---------ïåðåâîäèì êëþ÷ è èñõîä*ûé òåêñò â *èæ*èé ðåãèñòð.--------------------
key:=AnsiUpperCase(key);
s:=AnsiUpperCase(s);
//----óä*ëÿåì èç ñòðîêè âñå ñèìâîëû, *å âõîäÿùèå â **ø *ëô*âèò.-----------------
temp:='';
for i := 1 to length(s) do if pos(s[i],URusA)<>0 then temp:=temp+s[i];
s:=temp;
//----Ñîçä**èå êëþ÷åâîé ì*òðèöû, ñ èñïîëüçîâ**èåì êëþ÷åâîãî ñëîâ* "key".--------
temp:='';
for i:=1 to length(key) do
 if pos(key[i],temp)=0 then temp:=temp+key[i];
for i:=1 to length(URusA) do
 if pos(URusA[i],temp)=0 then temp:=temp+URusA[i];
t:=0;
for i:=1 to 4 do
 for j:=1 to 8 do
 begin
 inc(t);
 M[i,j]:=temp[t];
 form1.StringGrid1.Cells[j,i]:=temp[t];
 end;
 
 
//----ïðîñìîòð ñòðîêè ïî ï*ð*ì ñèìâîëîâ è âñò*âê* ð*çäåëÿþùåãî ñèìâîë*----------
        //"Ü" â ñëó÷*å êîãä* â ï*ðå ïîï*ëèñü îäè**êîâûå ñèìâîëû.
M1:
for i:=1 to length(s)div 2 do
  begin
  if s[2*i-1]=s[2*i] then
    begin
    insert('Ô',s,2*i);
    goto M1;
    end;
  end;
//-------Äîá*âëÿåì ñèìâîë â êî*åö ñòðîêè, åñëè å¸ äëè** *å÷¸ò**ÿ.---------------
if length(s) MOD 2 = 1 then if s[length(s)]<>'Ô' then s:=s+'Ô'
                                                 else s:=s+'ß';
temp:='';
for i:=1 to length(s)div 2 do
  begin
  SimbolPos(s[2*i-1],x1,y1);
  SimbolPos(s[2*i],x2,y2);
//-------------------------------Ïð*âèëî 1--------------------------------------
  if y1 = y2 then
    begin
    inc(x1); inc(x2);
    if x1 > MaxX then x1:=x1-MaxX;
    if x2 > MaxX then x2:=x2-MaxX;
    temp:=temp+M[y1,x1]+M[y2,x2];
    end;
//-------------------------------Ïð*âèëî 2--------------------------------------
  if x1 = x2 then
    begin
    inc(y1); inc(y2);
    if y1 > MaxY then y1:=y1-MaxY;
    if y2 > MaxY then y2:=y2-MaxY;
    temp:=temp+M[y1,x1]+M[y2,x2];
    end;
//-------------------------------Ïð*âèëî 3--------------------------------------
  if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
  end;
CPlayfair:=temp;
rot:=temp;
end;
 
function DePlayfair(s,key:string):string;
const
  //Ð*çìåð êëþ÷åâîé ì*òðèöû:
   MaxX = 8;//ñòðîêè
   MaxY = 4;//ñòîëáöû
  //Í*ø *ëô*âèò. Ð*çìåð äîëæå* áûòü MaxY*MaxX.
  //Ïîýòîìó â **øåì ñëó÷*å óáð**û áóêâó "¸".
  URusA = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß';
 
var i,j,t,x1,x2,y1,y2 :integer;
    M : array[1..MaxY,1..MaxX]of char; //êëþ÷åâ*ÿ ì*òðèö*
    temp :string;
 
//---------Ôó*êöèÿ ïîèñê* ñèìâîë* "ñ" â êëþ÷åâîé ì*òðèöå.-----------------------
              //Âîçâð*ù*åò ñòðîêó "y" è ñòîëáåö "x".
  Procedure SimbolPos(c:char;var x,y:integer);
  var i,j:integer;
  begin
  x:=0;
  y:=0;
  for i := 1 to MaxY do
    for j := 1 to MaxX do
      if c=M[i,j] then
        begin
        x:=j;
        y:=i;
        exit;
        end;
  end;
 
label M1;
begin
//---------ïåðåâîäèì êëþ÷ è èñõîä*ûé òåêñò â *èæ*èé ðåãèñòð.--------------------
key:=AnsiUpperCase(key);
s:=AnsiUpperCase(s);
//-------óä*ëÿåì èç ñòðîêè âñå ñèìâîëû, *å âõîäÿùèå â **ø *ëô*âèò.--------------
temp:='';
for i := 1 to length(s) do
  begin
  if pos(s[i],URusA)<>0 then temp:=temp+s[i];
  end;
s:=temp;
//---Ñîçä**èå êëþ÷åâîé ì*òðèöû, ñ èñïîëüçîâ**èåì êëþ÷åâîãî ñëîâ* "key".---------
temp:='';
for i:=1 to length(key) do
 if pos(key[i],temp)=0 then temp:=temp+key[i];
for i:=1 to length(URusA) do
 if pos(URusA[i],temp)=0 then temp:=temp+URusA[i];
t:=0;
for i:=1 to 4 do
 for j:=1 to 8 do
 begin
 inc(t);
 M[i,j]:=temp[t];
 end;
 
temp:='';
for i:=1 to length(s)div 2 do
  begin
  SimbolPos(s[2*i-1],x1,y1);
  SimbolPos(s[2*i],x2,y2);
//--------------Ïð*âèëî 1-------------------------------------------------------
  if y1 = y2 then
    begin
    dec(x1); dec(x2);
    if x1 <= 0 then x1:=x1+MaxX;
    if x2 <= 0 then x2:=x2+MaxX;
    temp:=temp+M[y1,x1]+M[y2,x2];
    end;
//-------------Ïð*âèëî 2--------------------------------------------------------
  if x1 = x2 then
    begin
    dec(y1); dec(y2);
    if y1 <= 0 then y1:=y1+MaxY;
    if y2 <= 0 then y2:=y2+MaxY;
    temp:=temp+M[y1,x1]+M[y2,x2];
    end;
//-------------Ïð*âèëî 3--------------------------------------------------------
  if (x1<>x2) and (y1<>y2) then temp:=temp+M[y1,x2]+M[y2,x1];
  end;
DePlayfair:=temp;
end;
 
 
function cEcezar(s: string; key: byte): string; // Øèôð öåç*ðÿ. Øèôðîâ**èå
var
  i: integer;
  c,d: char;
  rez: string;
begin
  rez := '';
  for i := 1 to length(s) do
    begin
      c := s[i];
      d := chr((ord(c) + key) mod 255);
      rez := rez + d;
    end;
  cEcezar := rez;
end;
 
function cDcezar(s: string; key: byte): string;
var
  i: integer;
  c,d: char;
  rez: string;
begin
  rez := '';
  for i := 1 to length(s) do
    begin
      c := s[i];
      d := chr((ord(c)-key) mod 255);
      rez := rez + d;
    end;
  cDcezar := rez;
end;
 
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  memo1.Clear;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
  memo2.Clear;
end;
 
procedure TForm1.Button3Click(Sender: TObject);
begin
  change.Execute;
end;
 
procedure TForm1.Button4Click(Sender: TObject);
begin
  if clr.Checked then
    memo2.Clear;
 
  if combobox1.ItemIndex = 0 then
    begin
    if radiogroup1.ItemIndex = 0 then
    CPlayfair.Execute
   else
   DePlayfair.Execute;
   end;
   if combobox1.ItemIndex = 1 then
    begin // öåç*ðü
      if RadioGroup1.ItemIndex = 0 then
        ECezar.Execute
       else
        DCezar.Execute;
    end;
end;
 
procedure TForm1.Button5Click(Sender: TObject);
begin
  if SaveDialog1.Execute then
    memo2.Lines.SaveToFile(SaveDialog1.FileName);
end;
 
procedure TForm1.Button6Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    memo1.Lines.LoadFromFile(openDialog1.FileName);
end;
 
procedure TForm1.changeExecute(Sender: TObject);
begin
  memo1.Lines := memo2.Lines;
  memo2.Clear;
end;
 
procedure TForm1.clearExecute(Sender: TObject);
begin
  memo2.Clear;
end;
 procedure TForm1.DCezarExecute(Sender: TObject);
var
  i: integer;
  key: byte;
begin
  key := StrToInt(inputBox('Øèôð Öåç*ðÿ','Ââåäèòå ç**÷å*èå êëþ÷* - òîëüêî öåëîå ÷èñëî','3'));
  for i := 0 to memo2.Lines.Count do
    memo3.Lines.Add(cDcezar(memo2.Lines[i],key));
end;
 
procedure TForm1.ECezarExecute(Sender: TObject);
var
  i: integer;
  key: byte;
begin
  key := StrToInt(inputBox('Øèôð Öåç*ðÿ','Ââåäèòå ç**÷å*èå êëþ÷* - òîëüêî öåëîå ÷èñëî','3'));
  for i := 0 to memo1.Lines.Count do
    memo2.Lines.Add(cEcezar(memo1.Lines[i],key));
end;
 
 
procedure TForm1.CPlayfairExecute(Sender: TObject);
var
 i: integer;
  key, st: string;
begin
st:=Memo1.Lines[i];
key:=Memo4.Lines[i];
    memo2.Text:=CPlayfair(st,key);
end;
 
 
procedure TForm1.DePlayfairExecute(Sender: TObject);
var
 i: integer;
  key, st: string;
begin
st:= Memo2.Lines[i];
key:=Memo4.Lines[i];
    memo3.Text:= Deplayfair(st,key));
end;
 
end.
0
Sergio Leone
2462 / 1107 / 579
: 07.06.2014
: 3,259
14.12.2014, 22:17 #4
Naura
, CPlayfair
Delphi !

?!
Delphi
1
    CPlayfair: TAction;
0
Naura
0 / 0 / 0
: 11.09.2014
: 4
14.12.2014, 22:31  [] #5
CPlayfair
0
Naura
0 / 0 / 0
: 11.09.2014
: 4
14.12.2014, 22:34  [] #6
.rar
0
Sergio Leone
2462 / 1107 / 579
: 07.06.2014
: 3,259
15.12.2014, 09:20 #7
Naura, , ?
0
15.12.2014, 09:20
MoreAnswers
37091 / 29110 / 5898
: 17.06.2006
: 43,301
15.12.2014, 09:20
! :

: Missing operator or semicolon
, , ...

Missing operator or semicolon
program Project6; {$APPTYPE CONSOLE} uses SysUtils; function...

: Missing operator or semicolon
f(x)... ! unit...

Missing operator or semicolon
&quot;Missing operator or semicolon&quot; 80, ...




:
7

- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
@Mail.ru