发布网友
共2个回答
热心网友
declare @j int,@o int,@i int
set @i=1
set @j=0
set @o=0
while @i<=40
begin
if(@i%2=1)
set @j=@j+@i*@i
else
set @o=@o+@i*@i
set @i=@i+1
end
print 'x='+convert(char(5),@j)+',y='+convert(char(5),@o)
热心网友
declare
x INTEGER:=0;
y INTEGER:=0;
i INTEGER:=0;
begin
loop
x:= (1+i*2)*(1+i*2)
y:=(2+i*2)*(2+i*2)
i:= i+1;
exit when i>19;
end loop;
DBMS_OUTPUT.PUT_LINE(To_char(x));
DBMS_OUTPUT.PUT_LINE(To_char(y));
end;
你试试?