tempat BERJUANG
About Me
- arista WHIE
- hai.. welcome to my blog... namaku wiwik.. Asli BALI.. aku kuliah di ITS jurusan STATISTIKA.. NRP 1311100020.. silahkan menikmati blogku.. see it n' enjoy it... semoga bermanfaat... kalau ad kurang g usah sungkan kasi komentar ya..
Diberdayakan oleh Blogger.
Pengikut
Selasa, 13 Desember 2011
program bintang berbentuk belah ketupat
program bintang_belahketupat;
uses wincrt;
var i,j,n,t,r :integer;
begin
readln (n);
t:=n div 2;
for r:=1 to n do
begin
if (r=t) then
begin
for i:=t downto 1 do
begin
for j:=2*t-1downto 1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end
else
if r=t+1 then
begin
for i:=1 to t do
begin
for j:=1 to 2*t-1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end;
end;
end.
uses wincrt;
var i,j,n,t,r :integer;
begin
readln (n);
t:=n div 2;
for r:=1 to n do
begin
if (r=t) then
begin
for i:=t downto 1 do
begin
for j:=2*t-1downto 1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end
else
if r=t+1 then
begin
for i:=1 to t do
begin
for j:=1 to 2*t-1 do
begin
if ((j<i) or (j>(2*t-1)-i+1)) then
write (' ') else
write ('*');
end;
writeln ;
end;
end;
end;
end.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar