输出者必加分
第一行1
第二行7 2
第三行12 8 3
第四行46 13 9 4
第五行19 17 14 10 5
第六行21 20 18 15 11 6
pascal输出数字 1 7 2 12 8 3 16 13 9 4 19 17 14 10 5 21 20 18 15 11 6
答案:6 悬赏:30 手机版
解决时间 2021-01-02 14:24
- 提问者网友:情歌越听越心酸
- 2021-01-02 11:00
最佳答案
- 五星知识达人网友:轻雾山林
- 2021-01-02 11:24
var a:array[1..6,1..6]of integer;
i,j:integer; t:integer;
begin
t:=6;
a[1,1]:=1;
for i:=2 to 6 do
begin
a[i,1]:=a[i,1]+t+a[i-1,1];
t:=t-1;
end;
for i:=2 to 6 do
begin
t:=6-i+1;
for j:=2 to i do
begin
a[i,j]:=a[i,j-1]-t;
t:=t+1;
end;
end;
for i:=1 to 6 do
begin
for j:=1 to i do write(a[i,j],' ');
writeln;
end;
end.
i,j:integer; t:integer;
begin
t:=6;
a[1,1]:=1;
for i:=2 to 6 do
begin
a[i,1]:=a[i,1]+t+a[i-1,1];
t:=t-1;
end;
for i:=2 to 6 do
begin
t:=6-i+1;
for j:=2 to i do
begin
a[i,j]:=a[i,j-1]-t;
t:=t+1;
end;
end;
for i:=1 to 6 do
begin
for j:=1 to i do write(a[i,j],' ');
writeln;
end;
end.
全部回答
- 1楼网友:忘川信使
- 2021-01-02 15:12
program f1;
begin
write(' 1 7 2 12 8 3 16 13 9 4 19 17 14 10 5 21 20 18 15 11 6');
readln;
end.
- 2楼网友:酒醒三更
- 2021-01-02 14:25
program f1(input,output);
begin
write(' 1 7 2 12 8 3 16 13 9 4 19 17 14 10 5 21 20 18 15 11 6');
readln;
end.
- 3楼网友:英雄的欲望
- 2021-01-02 13:54
begin
write(' 1 7 2 12 8 3 16 13 9 4 19 17 14 10 5 21 20 18 15 11 6');
end.
- 4楼网友:毛毛
- 2021-01-02 13:32
const
m=7;
var
a:array[1..m,1..m] of integer;
i,j,k:integer;
begin
for i:=1 to m do for j:=1 to m do a[i,j]:=0;
i:=1; j:=(m div 2)+1; k:=1;
a[i,j]:=k;
while j-1>=1 do begin
inc(i); dec(j); inc(k); a[i,j]:=k;
end;
while i+1<=m do begin
inc(i); inc(j); inc(k); a[i,j]:=k;
end;
while j+1<=m do begin
dec(i); inc(j); inc(k); a[i,j]:=k;
end;
while i-1>1 do begin
dec(i); dec(j); inc(k); a[i,j]:=k;
end;
for i:=1 to m do begin
for j:=1 to m do if a[i,j]=0
then write('':3) else write(a[i,j]:3);
writeln;
end;
end.
- 5楼网友:西岸风
- 2021-01-02 12:39
var a:array[1..20] of integer;
i,j,n:longint;
begin
n:=0;
for i:=1 to 20 do read(a[i]);//自己输数字
for i:=1 to 6 do
begin
for j:=1 to i do
begin
inc(n);
write(a[n],' ');
end;
writeln;
end;
end.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯