日期:2014-05-17 浏览次数:21179 次
declare
type t_type is table of number index by binary_integer;
type tt_type is table of t_type index by binary_integer;
n number := &n;
tt_array tt_type;
begin
tt_array(1)(1) := 1;
tt_array(2)(1) := 1;
tt_array(2)(2) := 1;
for i in 3 .. n loop
tt_array(i)(1) := 1;
for j in 2 .. i - 1 loop
tt_array(i)(j) := tt_array(i - 1) (j - 1) + tt_array(i - 1) (j);
end loop;
tt_array(i)(i) := 1;
end loop;
for i in 1 .. tt_array.count loop
for j in 1 .. i loop
dbms_output.put(tt_array(i) (j));
dbms_output.put(' ');
end loop;
dbms_output.put_line('');
end loop;
end;