Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Var
- fl,f,f2:File Of Byte;
- f3,f4: text;
- st,c1:string;
- i,j:Integer;
- b,c:Byte;
- Begin
- AssignFile(f3,'soobshenie.txt');
- Reset(f3);
- read(f3,st);
- Begin
- AssignFile(fl,'stihforprog.txt');
- Reset(fl);
- AssignFile(f,'shifrovka.txt');
- ReWrite(f);
- For i:=1 To Length(St) Do
- Begin
- C:=Ord(St[i]);
- For j:=7 downTo 0 Do
- Begin
- while not eof(fl) do begin
- read(fl,b);
- write(f,b);
- end;
- if c and (1 shl j) <> 0 then begin
- b:=32;
- write(f,b);
- end;
- writeln(f);
- if not eof(fl) then begin
- readln(fl,b);
- write(f,b);
- End;
- End;
- If Not Eof(fl) Then
- While Not Eof(fl) Do
- Begin
- If Eof(fl) Then Break;
- Read(fl,c);
- Write(f,c);
- End;
- CloseFile(fl);
- CloseFile(f);
- CloseFile(f3);
- End;
- Begin
- AssignFile(f2,'shifrovka.txt');
- Reset(f2);
- While Not Eof(f2) Do
- Begin
- c:=0;
- For i:=7 downto 0 Do
- Begin
- Repeat
- If Eof(f2) Then Break;
- Read(f2,b);
- Until eoln;
- If Eof(f2) Then Break;
- If b = 32 Then
- c:=c Or (1 shl i);
- readln(f2);
- End;
- AssignFile(f4,'vivod.txt');
- Rewrite(f4);
- begin
- c1:=chr(c);
- if c>0 then write(f4, c1)
- end;
- End;
- CloseFile(f2);
- CloseFile(f4);
- End;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement