Source codenya :
uses wincrt;
var
x,y,n:integer;
begin
writeln('------------------------------');
writeln(' Program mencetak huruf K ');
writeln('------------------------------');
writeln;
write('Masukkan angka : ');readln(n);
writeln;
writeln('Hasilnya : ');
writeln;
for y:=1 to n do
begin
for x:=1 to n do
begin
if (x=1) or (y-(n-y)=x) or (x=(((n-y))-y)+2) then
write('*')
else
write(' ');
end;
writeln;
end;
end.
uses wincrt;
var
x,y,n:integer;
begin
writeln('------------------------------');
writeln(' Program mencetak huruf K ');
writeln('------------------------------');
writeln;
write('Masukkan angka : ');readln(n);
writeln;
writeln('Hasilnya : ');
writeln;
for y:=1 to n do
begin
for x:=1 to n do
begin
if (x=1) or (y-(n-y)=x) or (x=(((n-y))-y)+2) then
write('*')
else
write(' ');
end;
writeln;
end;
end.
0 comments:
Posting Komentar