主题:[讨论]这么简单的程序也会有错
帮忙看下这个程序,我还不信他的:
一个vbscript程序:
<%
const N=9
dim i,j,temp
redim array1(N)
for i=0 to 9
array1(i)=9-i
next
response.write "输入数组中的内容为:"&"<br>"
for i=0 to N
response.write "array1("&i&")="&array1(i)&"<br>"
next
for i=0 to N
for j=i to N-i
if j>=N then exit for
else
if array1(j)<array1(j+1) then
temp=array1(j):array1(j)=array1(j+1):array1(j+1)=temp
end if
end if
next
next
response.write "排序后的结果为:"&"<br>"
for i=0 to N
response.write "array1("&i&")="&array(i)&"<br>"
next
%>
一个vbscript程序:
<%
const N=9
dim i,j,temp
redim array1(N)
for i=0 to 9
array1(i)=9-i
next
response.write "输入数组中的内容为:"&"<br>"
for i=0 to N
response.write "array1("&i&")="&array1(i)&"<br>"
next
for i=0 to N
for j=i to N-i
if j>=N then exit for
else
if array1(j)<array1(j+1) then
temp=array1(j):array1(j)=array1(j+1):array1(j+1)=temp
end if
end if
next
next
response.write "排序后的结果为:"&"<br>"
for i=0 to N
response.write "array1("&i&")="&array(i)&"<br>"
next
%>