我无法编译此程序,因为 Put_Line 方法似乎无法输出整数变量和字符串。我查看了在线源代码,当他们这样做时它能正常工作,所以我错在哪里了。谢谢你的帮助。
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure MultiplicationTable is
procedure Print_Multiplication_Table(Number :in Integer; Multiple :in Integer) is
Result : Integer;
begin
for Count in 1 ..Multiple
loop
Result := Number * Count;
Put_Line(Number & " x " & Count & " = " & Result);
end loop;
end Print_Multiplication_Table;
Number : Integer;
Multiple : Integer;
begin
Put("Display the multiplication of number: ");
Get(Number);
Put("Display Multiplication until number: ");
Get(Multiple);
Print_Multiplication_Table(Number,Multiple);
end MultiplicationTable;`
New_Line(1);
而不是只用New_Line;
呢? - Keith Thompson