我已经在 PLSQL 中编写了代码。在哪里我需要检查数字的立方和是否=自己编号。
我已经尝试遵守算法,仍然有一些错误。请帮助。我是 PLSQL 的新手。
以下是我的代码:
set serveroutput on;
Declare
I number(4);
Sum number(4):=0;
C number(15):=10;
Begin
for I in 1..999
loop
-- dbms_output.put_line(I);
Sum:=power(mod(I,C),3);
while mod(I,C)
loop
Sum:=power(mod(mod(I,C),C),3);
C:=C*10;
end loop;
if Sum=I then
dbms_output.put_line(I);
end if;
end loop;
End;
/