编译用Ada编程语言编写的代码时,会出现下一条消息:missing operand in deg:=degree();. 为什么以及如何解决此问题?
With Ada.Text_IO; Use Ada.Text_IO;
With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
With Ada.Strings.Unbounded; Use Ada.Strings.Unbounded;
procedure polynomial is
-- constructs a new polynomial term of the form a * x^b:
function Polynomial(a,b : Integer) return Integer is
type coef is array(Integer range <>)of Integer;
type deg is new Integer;
type c is new Integer;
begin
coef:=new int(b+1);
coef(b):=a;
deg:=degree(); --missing operand
return a;
end Polynomial;
Run Code Online (Sandbox Code Playgroud)