PASCAL 编程问题 急
来源:百度知道 编辑:UC知道 时间:2024/08/22 04:24:50
如何编程打出这个图形?
# @
# # @ @
# # # @ @ @
# @
# # @ @
# # # @ @ @
#是chr(35)
@是chr(64)
程序如下
for i:=1 to 3 do
begin
for j:=1 to i do
write(chr(35));
for h:=1 to i do
write(chr(64));
writeln;
end;
var
i,j:integer;
begin
for i:=1 to 3 do
begin
for j:=1 to i do
write('#');
for j:=1 to i do
write('@');
writeln;
end;
end.
为我做主啊,楼下都是抄我的。
program bamboobrook;
var
i,j,n:integer;
begin
readln(n); //n=3
for i:=1 to n do
begin
for j:=1 to i do
write('#');
for j:=1 to i do
write('@');
writeln;
end;
end.
begin
writeln('#@');
writeln('##@@');
writeln('###@@@');
end.
有几行,n就等于几,输入3,就输出你的那个图形,代码如下
var
i,j,n:integer;
begin
readln(n);
for i:=1 to n do
begin
begin
for j:=1 to i do
write('#');