turbo pascal7.0 问题:编写程序,使之能输出如下形式的”字母塔”:
答案:4 悬赏:80 手机版
解决时间 2021-01-25 01:25
- 提问者网友:半生酒醒
- 2021-01-24 01:01
turbo pascal7.0 问题:编写程序,使之能输出如下形式的”字母塔”:
最佳答案
- 五星知识达人网友:归鹤鸣
- 2021-01-24 01:13
要分的说………………
var
hang,kong,i,x:longint;
begin
readln(hang);
kong:=hang-1;
for i:=1 to hang do
begin
for x:=1 to kong do
write(' ');
for x:=1 to 2*i-1 do
write(chr(65+abs(x-i)));
writeln;
kong:=kong-1;
end;
end.
var
hang,kong,i,x:longint;
begin
readln(hang);
kong:=hang-1;
for i:=1 to hang do
begin
for x:=1 to kong do
write(' ');
for x:=1 to 2*i-1 do
write(chr(65+abs(x-i)));
writeln;
kong:=kong-1;
end;
end.
全部回答
- 1楼网友:掌灯师
- 2021-01-24 03:46
AD
- 2楼网友:撞了怀
- 2021-01-24 02:27
var
hang,kong,i,x:longint;
begin
readln(hang);
kong:=hang-1;
for i:=1 to hang do
begin
for x:=1 to kong do
write(' ');
for x:=1 to 2*i-1 do
write(chr(65+abs(x-i)));
writeln;
kong:=kong-1;
end;
end.
hang,kong,i,x:longint;
begin
readln(hang);
kong:=hang-1;
for i:=1 to hang do
begin
for x:=1 to kong do
write(' ');
for x:=1 to 2*i-1 do
write(chr(65+abs(x-i)));
writeln;
kong:=kong-1;
end;
end.
- 3楼网友:西岸风
- 2021-01-24 02:04
var i,j:integer;
begin
for i:=1 to 26 do
begin
for j:=1 to 26-i do
write(' ');
for j:=1 to i do
write(chr(64+j));
for j:=i-1 downto 1 do
write(chr(64+j));
writeln;
end;
end.
begin
for i:=1 to 26 do
begin
for j:=1 to 26-i do
write(' ');
for j:=1 to i do
write(chr(64+j));
for j:=i-1 downto 1 do
write(chr(64+j));
writeln;
end;
end.
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯