<html> <head> <title>冒泡排序</title> <script type="text/javascript" language="javascript"> var str=new Array("8","3","5","7","1"); for(var i=0;i<str.length;i++){ for(var j=i+1; j<str.length;j++){ if(str[i]>str[j]) {var m; m=str[i];str[i]=str[j];str[j]=m; } } } alert(str); </script> </head> </body> </html>
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/98515.html