You are on page 1of 1

Corrigé BAC Pratique Informatique 2017 Correction proposée par

Section Math & Sciences & Technique Mr nour abdelhedi

25 Mai 11h-12h

program cryptage; begin

uses wincrt; l:=length(m);

var m:string; ch:='';

function ch1:=m;
valide(ch:string):boolean;
for i:=2 to l div 2 do
var i,l,somdiv:integer;
begin
begin
if l mod i=0 then
l:=length(ch);
begin
somdiv:=0;
k:=0;
for i:=1 to l div 2 do
repeat
if l mod i =0 then
j:=k+i+1;
somdiv:=somdiv+1;
repeat
if (l>4) and (somdiv<>1) then
j:=j-1;
valide:=true
ch:=ch+ch1[j];
else
until (j=k+1);
valide:=false;
k:=k+i;
end;
until (k>l-1);
procedure saisie(var m :string);
end;
begin
ch1:=ch;
repeat
ch:='';
write('Donner le message a
end;
crypter');
Devoirs et examens : www.kiteb.net

crypter:=ch1;
readln(m);
end;
until (valide(m));
begin
end;
saisie(m);
function
crypter(m:string):string; writeln(crypter(m));
var i,j,k,l:integer; end.
ch,ch1:string;

You might also like