0
。有问题的线路是阿达指数检查失败
End_String := End_String & Get_Character(
S, Ind(Count*(length(Cipher_Text))/2), Ind(Count));
任何帮助将不胜感激。我正在使用Ada 95和一个GNAT编译器。
function Decipher(S : Square; Cipher_Text : Ustring) return Ustring is
type IndArray is array(1..(length(Cipher_Text)*2)) of Integer;
Ind : IndArray;
Temp : Character;
Row : Integer;
Col : Integer;
Count : Integer := 1;
End_String : Ustring;
begin
Ind := (others=>0);
for I in 1..length(Cipher_Text) loop
Temp := Uppercase(Element(Cipher_Text, I));
if In_Square(S, Temp) then
Get_Coordinates(S, Temp, Row, Col);
Ind(I) := row;
Ind(I + length(Cipher_Text)) := Col;
end if;
end loop;
while Count <= length(Cipher_Text)*2 loop
End_String := End_String & Get_Character(
S, Ind(Count*(length(Cipher_Text))/2), Ind(Count));
Count := Count + 2;
end loop;
return End_String;
end Decipher;
没有Ustring的声明,我们可能不会看到有什么问题。 –
抱歉,我只是将Ustring声明为Unbounded_String,以便在规范文件中将其缩短。 – user2396120