1
我已經在PLSQL中編寫了代碼。 在我需要的地方檢查數字立方體的總和=數字本身。檢查數字立方體的總和=數字本身
我試着遵守算法,仍然有一些errors.Please幫助。 我是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;
/
數據庫可以做到這一點?太棒了。 – Yehonatan 2010-11-28 15:04:39