zoukankan      html  css  js  c++  java
  • 垃圾弟弟

    <html>
    <head>
    </head>
    <body>
    <form name=form1>
    <input name=a123>
    <input name=b123>
    <input name=c123>
    <input name=d123>
    <input name=e123>
    <input name=f123 type=button onclick=check()>
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    Array.prototype.unique1 = function()
    {
       var a = {};
     var len = 0;
     for(var i=0; i<this.length; i++)
       {
      //alert('号码:'+i);
      //alert('初始:'+a[this[i]]);
      //alert(this[i]);
         if(typeof a[this[i]] == "undefined")
      {
            a[this[i]] = 1;
       len +=1;
      }
      
      //alert('结束:'+a[this[i]]);
     }
     
      this.length  = len;
      //for(var i in a)
         //this[this.length] = i;
       return this;
    }
    function check()
    {
      var ArrText = [document.form1.a123.value,document.form1.b123.value,document.form1.c123.value,document.form1.d123.value,document.form1.e123.value];
     OldArr=ArrText.length;
     //alert(ArrText.unique);
     //NewArr=ArrText.prototype;
      NewArr=ArrText.unique1().length;
      if(OldArr==NewArr)
      {
        alert("无");
     }
      else
      {
       alert("有");
     }
    }
    </SCRIPT>
    </body>
    </html>
     

    static bool trystore(string[] test)
            {
                for (int i = 0; i < test.Length; i++)
                {
                    for (int f = i+1; f < test.Length; f++)
                    {
                        if (test[i] == test[f])
                            return true;
                    }
                }
                return false;
            }

  • 相关阅读:
    linux_一些shell命令分析记录
    linux shell if
    linux_磁盘挂载
    远程工具记录
    oracle_多字段统计(多count)
    tomcat_日志打印格式问题
    cgo -rpath指定动态库路径
    Ubuntu下两个gcc版本切换
    [转]Go与C语言的互操作
    [转]【流媒體】H264—MP4格式及在MP4文件中提取H264的SPS、PPS及码流
  • 原文地址:https://www.cnblogs.com/zwei1121/p/1050155.html
Copyright © 2011-2022 走看看