主题:关于一个画“*”号的问题
guozhushenyu
[专家分:30] 发布于 2007-06-26 14:41:00
问:画出 ** **
** **
** **
** **
** **
** **
** **
**
请大家帮忙写一下
别告诉我用writeln('** **
** **
** **
** **
** **
** **
** **
**')
回复列表 (共5个回复)
沙发
Matodied [专家分:7560] 发布于 2007-06-26 21:30:00
VAR
i, j, prevspc, midspc: INTEGER;
BEGIN
prevspc := 0;
midspc := 26;
FOR i:=1 TO 7 DO BEGIN
FOR j:=1 TO prevspc DO WRITE(' ');
WRITE('**');
FOR j:=1 TO midspc DO WRITE(' ');
WRITELN('**');
prevspc := prevspc + 2;
midspc := midspc - 4;
END;
FOR i:=1 TO prevspc DO WRITE(' ');
WRITELN('**');
READLN;
END.
板凳
bigchen [专家分:1940] 发布于 2007-06-27 12:09:00
var
i,j,k,l:integer;
begin
k:=12;
for i:=1 to 7 do
begin
write('**');
if k<>0 then
for j:=1 to k do
write('**');
k:=k-2;
end;
end.
3 楼
逍遥兔. [专家分:0] 发布于 2007-07-12 19:08:00
program ko;
var r,t:integer;
begin
r:=1 to 8 do
t:=1 to 15 do
writeln('**'r,i);
end.
4 楼
007bond [专家分:540] 发布于 2007-07-14 08:13:00
var i,j,n:integer;
begin
readln(n);
for i:=1 to n do
begin
if i<>1 then write(' ':(i-1)*2);
write('**');
if i<>n then write(' ':(n-i)*4-2,'**');
writeln;
end;
end.
方便快捷,不占过多内存,绝对有效
5 楼
迷路的天使 [专家分:1340] 发布于 2007-11-21 17:54:00
我想问你``~````
我来回复