Salut tt le monde, Svp est ce que vs pouvez m'aider
mon probleme c'est qnad j'execute le code ci-dessous sur maple il m'affiche l'erreur Error, invalid terms in product , je c pas , ou est le prob :
Cryptegraph:=proc(message)
local taille, ww, mm, m1, m2, C1, C2, ss, resultat, ii, jj, xx, yy,num;
num:=table(["a" = "(9, 10)", "b" = "(18, 29)", "c" ="(23, 19)", "d" = "(4, 22)"]);
taille:= length(message):
resultat:= " ":
ww:= "1100101111":
xx:= 6:
yy:= 7:
for ii from 1 to taille do
mm:= message [ii]:
ss:= num [mm]: jj:= 2:
m1:= " ":
m2:= " ":
while (substring (ss, jj) < > ",") do
m1:= cat (m1, substring (ss, jj)):
jj:= jj + 1:
od:
jj:= jj + 1:
while (substring (ss, jj) < > ")") do
m2:= cat (m2, substring (ss, jj)):
jj:= jj + 1:
od:
m1:= parse (m1);
m2:= parse (m2):
C1:= (m1*xx) mod 31:
C2:= (m2*yy) mod 31:
C1:= convert (C1, binary):
C1:= convert (C1, string):
if (length (C1) < 6) then
for jj from 1 to 5-length (C1) do
C1:= cat ("0", C1):
od: fi:
C2:= convert (C2, binary):
C2:= convert (C2, string):
if (length (C2) < 6) then
for jj from 1 to 5-length (C2) do
C2:= cat ("0", C2):
od: fi:
resultat:= cat (resultat, ww):
resultat:= cat (resultat, C1):
resultat:= cat (resultat, C2):
return resultat:
od:
end proc:
Error, invalid terms in product
Merci d'avance
Partager