program bintang (belah ketupat);
uses wincrt;
var n, a, b : integer;
begin
clrscr;
write ('Masukkan angka : '); readln (n);
for a := 1 to n do
begin
for b := 1 to (2*n)-a do
begin
write (' ');
end;
for b:= 1 to (2*a)-1 do
begin
write ('*');
end;
writeln;
end;
for a := 1 to n do
begin
for b := 1 to n-a do
begin
write (' ');
end;
for b := 1 to a do
begin
write ('*');
end;
for b := 1 to (2*n)-1 do
begin
write (' ');
end;
for b := 1 to a do
begin
write ('*');
end;
writeln;
end;
for a := 1 to n-1 do
begin
for b := 1 to a do
begin
write (' ');
end;
for b := 1 to n-a do
begin
write ('*');
end;
for b := 1 to (2*n)-1 do
begin
write (' ');
end;
for b := 1 to n-a do
begin
write ('*');
end;
writeln;
end;
for a := 0 to n-1 do
begin
for b := 1 to n+a do
begin
write (' ');
end;
for b := 2 to (2*n)-(a*2) do
begin
write ('*');
end;
writeln;
end;
readln;
end.
layout
No comments:
Post a Comment
Silahkan masukkan komentar sobat, komentar sobat sangat berarti buat saya