level 3
dim as integer x,y,s,n,i,j,p
dim as integer a(10,10)
cls
input n
for i=0 to n-1
for j=0 to n-1
a(i,j)=0
next j
next i
x=n-1
y=n-1
s=0
p=n*n
do while s<p
while a(x,y)=0 and x<n :s=s+1 :a(x,y)=s :x=x-1 :wend
x=x+1
y=y-1
while a(x,y)=0 and y>=0 :s=s+1 :a(x,y)=s :y=y-1 :wend
x=x+1
y=y+1
while a(x,y)=0 and x<n :s=s+1:a(x,y)=s :x=x+1 :wend
x=x-1
y=y+1
while a(x,y)=0 and y<n :s=s+1:a(x,y)=s :y=y+1 :wend
x=x-1
y=y-1
loop
print
for i=0 to n-1
for j=0 to n-1
print a(i,j);
next j
print
next i
sleep
一起 学习!!!
2012年08月01日 13点08分
