主题:矩阵旋转的填空题2道
1、
旋转前:
1 2 3
4 5 6
7 8 9
旋转后:
9 8 7
6 5 4
3 2 1
程序:
cls
dim a(3,3)
for i=1 to 3
for j=1 to 3
read a(i,j)
print a(i,j);" ";
print
nextj
next i
data 1,2,3,4,5,6,7,8,9
for i=[u] 1 [/u]
for j=[u] 2 [/u]
print a(i,j);" ";
next j
print
next i
end
2、
旋转前:
2 4 6 8
1 2 3 4
1 3 5 7
5 6 7 8
旋转后:
8 6 4 2
4 3 2 1
7 5 3 1
8 7 6 5
程序:
cls
dim a(4,4)
data 2,4,6,8,1,2,3,4,1,3,5,7,5,6,7,8
for i=1 to 4
for j=1 to 4
read a(i,j)
print a(i,j);" ";
print
nextj
next i
for i= 1 to 4
for j= 1 to 4
print [u] 1 [/u]
next j
print
next i
end
[em18][em18][em18]
知道的快回啊!
格式:
1、
1:......
2:......
2、
1:......
知道1题的也回啊!
旋转前:
1 2 3
4 5 6
7 8 9
旋转后:
9 8 7
6 5 4
3 2 1
程序:
cls
dim a(3,3)
for i=1 to 3
for j=1 to 3
read a(i,j)
print a(i,j);" ";
nextj
next i
data 1,2,3,4,5,6,7,8,9
for i=[u] 1 [/u]
for j=[u] 2 [/u]
print a(i,j);" ";
next j
next i
end
2、
旋转前:
2 4 6 8
1 2 3 4
1 3 5 7
5 6 7 8
旋转后:
8 6 4 2
4 3 2 1
7 5 3 1
8 7 6 5
程序:
cls
dim a(4,4)
data 2,4,6,8,1,2,3,4,1,3,5,7,5,6,7,8
for i=1 to 4
for j=1 to 4
read a(i,j)
print a(i,j);" ";
nextj
next i
for i= 1 to 4
for j= 1 to 4
print [u] 1 [/u]
next j
next i
end
[em18][em18][em18]
知道的快回啊!
格式:
1、
1:......
2:......
2、
1:......
知道1题的也回啊!