复代码码 代码如下: 杨氏矩阵查找<br>function xunhuan()<br>{<br> var m =parseInt(document.getElementsByTagName("input")[0].value)||document.getElementsByTagName("input")[0].getAttribute("value");<br>var n =parseInt(document. getElementsByTagName("input")[1].value)||document.getElementsByTagName("input")[1].getAttribute("value");<br>var t =parseInt(document.getElementsByTagName("input")[ 2].value)||document.getElementsByTagName("input")[2].getAttribute("value");<br> if(m >= 1&&n <= 1000&&t >= 1&&t <= 1000000)<BR> {<BR> var num = 2;<BR> for(var x = 0;x < m;x )<BR> {<BR> for(var y = 0;y < n;y )<BR> {<BR> document.write((num ) " ");<BR> }<BR> document.write("<br/>");<br> } <br> var a=new Array();<br> for(var e = m*n 1;e > 1; e--)<br> {<br> a.splice(0,0,e)<br> > function chazhao(a,number)<br>{<br> document.write(isCon(a, number));<br> function isCon(a, number)<br> {<br> for(var i=0; i<a.length; i )<BR> {<BR> if(a[i] === number)<BR> {<BR> return String(true);<BR> }<BR> }<BR> return String(false);<BR> }<BR>}<BR>矩阵行数: 矩阵列数:查询数字: