PROGRAM SEGITIGA PASCAL
uses wincrt;
var
n,i,j:integer;
x:array [1..100,1..100] of integer;
begin
write('masukkan jumlah baris : '); readln(n);
for i:=1 to n do
for j:=1 to i do
begin
if j=1 then x[i,j]:=1
else if j=i then x[i,j]:=1
else x[i,j]:=x[i-1,j-1]+x[i-1,j]
end;
for i:=1 to n do
begin
gotoxy (40-3*i,2+1);
for j:=1 to i do
write(x[i,j]:6);
end;
end.
Tidak ada komentar:
Posting Komentar