Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторная работа по ЗИ / Unit1
.pas unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
type Tmass=array[1..100] of integer;
procedure TForm1.Button1Click(Sender: TObject);
var text,vopros:string;
text1:string[100];
j,i,l,k:integer;
mass:Tmass;
shif:array[1..100] of string;
begin
text:=Memo1.Text;
for i:=1 to length(text) do
begin
if (ord(text[i])>90) then
mass[i]:=ord(text[i])-3
else mass[i]:=(ord(text[i])+65);
end;
for j:=1 to length(text) do begin text1[j]:=chr(mass[j]); end;
text:='';
for i:=1 to 100 do text:=text+text1[i];
Memo2.Lines.add(text);
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
type Tmass=array[1..100] of integer;
procedure TForm1.Button1Click(Sender: TObject);
var text,vopros:string;
text1:string[100];
j,i,l,k:integer;
mass:Tmass;
shif:array[1..100] of string;
begin
text:=Memo1.Text;
for i:=1 to length(text) do
begin
if (ord(text[i])>90) then
mass[i]:=ord(text[i])-3
else mass[i]:=(ord(text[i])+65);
end;
for j:=1 to length(text) do begin text1[j]:=chr(mass[j]); end;
text:='';
for i:=1 to 100 do text:=text+text1[i];
Memo2.Lines.add(text);
end;
end.