DECLARE
TYPE num_tt IS TABLE OF INT;
num_t1 num_tt:=num_tt();
num_t2 num_tt:=num_tt();
num_t3 num_tt:=num_tt();
i_1 INT := 1;
j_1 INT := 1;
d_1 INT := 1;
BEGIN
num_t1.extend(20);
num_t2.extend(20);
num_t3.extend(num_t1.count+num_t2.count);
FOR i IN 1..20 LOOP
num_t1(i) := trunc(dbms_random.value(200,100000));
END LOOP;
dbms_output.put_line('num_t1:');
quick_sort(num_t1, 1, num_t1.count);
FOR i IN 1..num_t1.count LOOP
dbms_output.put_line(num_t1(i)||',');
END LOOP;
FOR i IN 1..20 LOOP
num_t2(i) := trunc(dbms_random.value(200,100000));
END LOOP;
dbms_output.put_line('num_t2:');
quick_sort(num_t2, 1, num_t2.count);
FOR i IN 1..num_t2.count LOOP
dbms_output.put_line(num_t2(i)||',');
END LOOP;
WHILE(i_1 <= num_t1.count AND j_1 <= num_t2.count) LOOP
IF(num_t1(i_1) > num_t2(j_1)) THEN
num_t3(d_1) := num_t2(j_1);
j_1 := j_1 + 1;
ELSE
num_t3(d_1) := num_t1(i_1);
i_1 := i_1 + 1;
END IF;
d_1 := d_1 + 1;
END LOOP;
IF(i_1<=num_t1.count) THEN
FOR i IN i_1..num_t1.count LOOP
num_t3(d_1) := num_t1(i);
d_1 := d_1+1;
END LOOP;
ELSE
FOR i IN j_1..num_t2.count LOOP
num_t3(d_1) := num_t2(i);
d_1 := d_1+1;
END LOOP;
END IF;
dbms_output.put_line('num_t3:');
FOR i IN 1..num_t3.count LOOP
dbms_output.put_line(num_t3(i)||',');
END LOOP;
END;
10年積累的成都做網(wǎng)站、網(wǎng)站建設(shè)經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識你,你也不認(rèn)識我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有南江免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。