锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产AV无码专区亚洲精品,亚洲美女一区二区三区,亚洲中文字幕无码一去台湾http://m.tkk7.com/wqnashqu/category/24620.html宸ヤ綔鏃ュ織鈥︹? <!-- SiteSearch Google --> <form method="get" action="http://www.google.com/custom" target="_top"> <table border="0" background ="http://m.tkk7.com/images/blogjava_net/wqnashqu/yan.gif"> <tr><td nowrap="nowrap" valign="top" align="left" height="32"> </td> <td nowrap="nowrap"> <input type="hidden" name="domains" value="codesearch.google.com;m.tkk7.com;www.ibm.com"></input> <label for="sbi" style="display: none">杈撳叆鎮(zhèn)ㄧ殑鎼滅儲(chǔ)瀛楄瘝</label> <input type="text" name="q" size="26" maxlength="255" value="" id="sbi"></input> <label for="sbb" style="display: none">鎻愪氦鎼滅儲(chǔ)琛ㄥ崟</label> <input type="submit" name="sa" value="Google 鎼滅儲(chǔ)" id="sbb"></input> </td></tr> <tr> <td>&nbsp;</td> <td nowrap="nowrap"> <table> <tr> <td> <input type="radio" name="sitesearch" value="" checked id="ss0"></input> <label for="ss0" title="鎼滅儲(chǔ)緗戠粶"><font size="-1" ">Web</font></label></td> <td> <input type="radio" name="sitesearch" value="codesearch.google.com" id="ss1"></input> <label for="ss1" title="鎼滅儲(chǔ) codesearch.google.com"><font size="-1" >codesearch.google.com</font></label></td> </tr> <tr> <td> <input type="radio" name="sitesearch" value="m.tkk7.com" id="ss2"></input> <label for="ss2" title="鎼滅儲(chǔ) m.tkk7.com"><font size="-1" >m.tkk7.com</font></label></td> <td> <input type="radio" name="sitesearch" value="www.ibm.com" id="ss3"></input> <label for="ss3" title="鎼滅儲(chǔ) www.ibm.com"><font size="-1" >www.ibm.com</font></label></td> </tr> </table> <input type="hidden" name="client" value="pub-5842524610105352"></input> <input type="hidden" name="forid" value="1"></input> <input type="hidden" name="ie" value="GB2312"></input> <input type="hidden" name="oe" value="GB2312"></input> <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:45;LW:166;L:http://m.tkk7.com/images/logo.gif;S:http://m.tkk7.com/wqnashqu;FORID:1"></input> <input type="hidden" name="hl" value="zh_CN"></input> </td></tr></table> </form> <!-- SiteSearch Google -->zh-cnFri, 14 Mar 2008 15:01:01 GMTFri, 14 Mar 2008 15:01:01 GMT60涓涓鐞嗛昏緫琛ㄨ揪寮忕殑java紼嬪簭http://m.tkk7.com/wqnashqu/archive/2008/02/26/182285.html鏇插己 Nicky鏇插己 NickyTue, 26 Feb 2008 11:05:00 GMThttp://m.tkk7.com/wqnashqu/archive/2008/02/26/182285.htmlhttp://m.tkk7.com/wqnashqu/comments/182285.htmlhttp://m.tkk7.com/wqnashqu/archive/2008/02/26/182285.html#Feedback2http://m.tkk7.com/wqnashqu/comments/commentRss/182285.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/182285.html闃呰鍏ㄦ枃

鏇插己 Nicky 2008-02-26 19:05 鍙戣〃璇勮
]]>
classcial dialogue about Rule Engine_Rete...http://m.tkk7.com/wqnashqu/archive/2007/11/29/163937.html鏇插己 Nicky鏇插己 NickyThu, 29 Nov 2007 02:42:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/11/29/163937.htmlhttp://m.tkk7.com/wqnashqu/comments/163937.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/11/29/163937.html#Feedback5http://m.tkk7.com/wqnashqu/comments/commentRss/163937.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/163937.htmlA variation on the bookstore could be recommendation engine. That would provide an opportunity to use a rule engine for direct matching on category/subcategory and aggregations.  闃呰鍏ㄦ枃

鏇插己 Nicky 2007-11-29 10:42 鍙戣〃璇勮
]]>
Trace Iamgehttp://m.tkk7.com/wqnashqu/archive/2007/10/30/155837.html鏇插己 Nicky鏇插己 NickyTue, 30 Oct 2007 13:36:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/30/155837.htmlhttp://m.tkk7.com/wqnashqu/comments/155837.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/30/155837.html#Feedback0http://m.tkk7.com/wqnashqu/comments/commentRss/155837.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/155837.htmlEach line segment will be of the form " " (quotes for clarity), representing a segment from (x1,y1) to (x2,y2). Segments may cross each other. Segments may also overlap, in which case you should count the overlapping region as appearing in the drawing only once. For example, say t  闃呰鍏ㄦ枃

]]>
Lottery Againhttp://m.tkk7.com/wqnashqu/archive/2007/10/24/155675.html鏇插己 Nicky鏇插己 NickyWed, 24 Oct 2007 13:20:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/24/155675.htmlhttp://m.tkk7.com/wqnashqu/comments/155675.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/24/155675.html#Feedback1http://m.tkk7.com/wqnashqu/comments/commentRss/155675.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/155675.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-10-24 21:20 鍙戣〃璇勮
]]>
A Q of Encrypting Stringhttp://m.tkk7.com/wqnashqu/archive/2007/10/23/155268.html鏇插己 Nicky鏇插己 NickyTue, 23 Oct 2007 05:34:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/23/155268.htmlhttp://m.tkk7.com/wqnashqu/comments/155268.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/23/155268.html#Feedback1http://m.tkk7.com/wqnashqu/comments/commentRss/155268.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/155268.htmlLet's say you have a binary string such as the following:
011100011
One way to encrypt this string is to add to each digit the sum of its adjacent digits. For example, the above string would become:
123210122  闃呰鍏ㄦ枃

鏇插己 Nicky 2007-10-23 13:34 鍙戣〃璇勮
]]>
Maze Problemhttp://m.tkk7.com/wqnashqu/archive/2007/10/21/154769.html鏇插己 Nicky鏇插己 NickySun, 21 Oct 2007 13:28:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/21/154769.htmlhttp://m.tkk7.com/wqnashqu/comments/154769.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/21/154769.html#Feedback1http://m.tkk7.com/wqnashqu/comments/commentRss/154769.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/154769.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-10-21 21:28 鍙戣〃璇勮
]]>
TopCoder_2http://m.tkk7.com/wqnashqu/archive/2007/10/21/154756.html鏇插己 Nicky鏇插己 NickySun, 21 Oct 2007 12:14:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/21/154756.htmlhttp://m.tkk7.com/wqnashqu/comments/154756.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/21/154756.html#Feedback1http://m.tkk7.com/wqnashqu/comments/commentRss/154756.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/154756.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-10-21 20:14 鍙戣〃璇勮
]]>
TopCoder_1http://m.tkk7.com/wqnashqu/archive/2007/10/20/154480.html鏇插己 Nicky鏇插己 NickySat, 20 Oct 2007 05:25:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/10/20/154480.htmlhttp://m.tkk7.com/wqnashqu/comments/154480.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/10/20/154480.html#Feedback1http://m.tkk7.com/wqnashqu/comments/commentRss/154480.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/154480.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-10-20 13:25 鍙戣〃璇勮
]]>
鎷愮偣鎻愬彇娉曞湪鏇茬嚎鎷熷悎涓殑綆鍗曞簲鐢?/title><link>http://m.tkk7.com/wqnashqu/archive/2007/08/14/136735.html</link><dc:creator>鏇插己 Nicky</dc:creator><author>鏇插己 Nicky</author><pubDate>Tue, 14 Aug 2007 09:27:00 GMT</pubDate><guid>http://m.tkk7.com/wqnashqu/archive/2007/08/14/136735.html</guid><wfw:comment>http://m.tkk7.com/wqnashqu/comments/136735.html</wfw:comment><comments>http://m.tkk7.com/wqnashqu/archive/2007/08/14/136735.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/wqnashqu/comments/commentRss/136735.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/wqnashqu/services/trackbacks/136735.html</trackback:ping><description><![CDATA[     鎽樿: 鏈▼搴忎負(fù)浼樺寲錛屾瘮杈冨ソ鐨勬柟娉曟槸錛岃繘琛屾洸綰跨Н鍒嗭紝綆楄宸瘮榪涜鏂圭▼綰︽潫錛岀敱浜庢椂闂存瘮杈冨皯錛岀◢鍊欎細(xì)緇欏嚭浼樺寲紼嬪簭銆?nbsp; <a href='http://m.tkk7.com/wqnashqu/archive/2007/08/14/136735.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/wqnashqu/aggbug/136735.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/wqnashqu/" target="_blank">鏇插己 Nicky</a> 2007-08-14 17:27 <a href="http://m.tkk7.com/wqnashqu/archive/2007/08/14/136735.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Stack Simple implementhttp://m.tkk7.com/wqnashqu/archive/2007/08/03/134301.html鏇插己 Nicky鏇插己 NickyFri, 03 Aug 2007 10:14:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/08/03/134301.htmlhttp://m.tkk7.com/wqnashqu/comments/134301.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/08/03/134301.html#Feedback0http://m.tkk7.com/wqnashqu/comments/commentRss/134301.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/134301.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-08-03 18:14 鍙戣〃璇勮
]]>
To find a max segment in a array which includes negative and positive no.http://m.tkk7.com/wqnashqu/archive/2007/07/31/133552.html鏇插己 Nicky鏇插己 NickyTue, 31 Jul 2007 04:45:00 GMThttp://m.tkk7.com/wqnashqu/archive/2007/07/31/133552.htmlhttp://m.tkk7.com/wqnashqu/comments/133552.htmlhttp://m.tkk7.com/wqnashqu/archive/2007/07/31/133552.html#Feedback0http://m.tkk7.com/wqnashqu/comments/commentRss/133552.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/133552.html闃呰鍏ㄦ枃

鏇插己 Nicky 2007-07-31 12:45 鍙戣〃璇勮
]]>
澶у鏉ヨ瘯璇曡繍姘斿晩...嬈㈣繋緇欏嚭緙╁噺鐗堟湰http://m.tkk7.com/wqnashqu/archive/2006/10/12/74845.html鏇插己 Nicky鏇插己 NickyThu, 12 Oct 2006 10:45:00 GMThttp://m.tkk7.com/wqnashqu/archive/2006/10/12/74845.htmlhttp://m.tkk7.com/wqnashqu/comments/74845.htmlhttp://m.tkk7.com/wqnashqu/archive/2006/10/12/74845.html#Feedback0http://m.tkk7.com/wqnashqu/comments/commentRss/74845.htmlhttp://m.tkk7.com/wqnashqu/services/trackbacks/74845.html    *@ the titlt  about a Random example about choose 7 from 33
    *@ the auther Nicky (EN) QuQiang(CH)
    *@ the date   2006.9.1
**/



/** the rules

//涓絳夊錛氶変腑錛栦釜姝i夊彿鍙?qiáng)鐗瑰埆鍙峰Q?br>
//浜岀瓑濂栵細(xì)閫変腑錛曚釜姝i夊彿鍙?qiáng)鐗瑰埆鍙峰Q?br>
//涓夌瓑濂栵細(xì)閫変腑錛曚釜姝i夊彿錛?br>
//鍥涚瓑濂栵細(xì)閫変腑錛斾釜姝i夊彿鍙?qiáng)鐗瑰埆鍙峰Q?br>
//浜旂瓑濂栵細(xì)閫変腑錛斾釜姝i夊彿鎴栭変腑錛撲釜姝i夊彿鍙?qiáng)鐗瑰埆鍙峰Q?br>
//鍏瓑濂栵細(xì)閫変腑錛撲釜姝i夊彿銆?br>
**/

import java.util.*;

public class NotSameRandoml{
     private static String transform;
     private static String match="00";
     private static int special;


  //浜х敓褰╃エ涓婚昏緫鍑芥暟
   private static void Nicky(int[] guess){
      Random r = new Random();     //鏋勯犱吉闅忔満鐢熸垚鍣?br>      //鏌愪簺鏄犲皠瀹炵幇鍙槑紜繚璇佸叾欏哄簭錛屽 TreeMap 綾伙紱鏌愪簺鏄犲皠瀹炵幇鍒欎笉淇濊瘉欏哄簭錛屽 HashMap 綾?br>      Map map = new TreeMap();   //Map 鎺ュ彛鐨勫疄鐜?br>      int n = 0;
      int nt = 1;
      String[] temps=new String[7];
      
      while(true){
          n = r.nextInt(33)+1; //浜х敓1~33鐨勯殢鏈烘暟
          //if( map.get(new Integer(n))!=null){
          //   nt = ((Integer)map.get(new Integer(n))).intValue();  
          //}
          //閬垮厤浜?jiǎn)漶旂敓鐨勯殢鏈烘暟瀛楅噸澶?br>          if(map.containsValue(n)){
            continue;
          }
          map.put(new Integer(nt),new Integer(n));//灝嗘寚瀹氱殑鍊間笌姝ゆ槧灝勪腑鐨勬寚瀹氶敭鐩稿叧鑱?br>          if(map.size()==7){
             break;
          }
          nt++;
      }
      
      Iterator it = map.keySet().iterator(); //榪斿洖姝ゆ槧灝勪腑鍖呭惈鐨勯敭鐨?set 瑙嗗浘
      for(int i=0;it.hasNext();i++){
       Object o = it.next();
        // 涓轟簡(jiǎn)鏇寸鍚堢幇瀹炰腑33閫?錛屾暟瀛椾負(fù)01銆傘傘?浣?br>       int temp=((Integer)map.get(o)).intValue();
       if(temp>=1&&temp<10){
           transform="0"+Integer.toString(temp);
           match=match+" "+transform;
           temps[i]=transform;
           if(((Integer)o).intValue()==7){
                   special=temp;
                   System.out.println(""+transform+"涓轟駭鐢熺殑鐗瑰埆涓涓鍙風(fēng)爜");
               }else  
                 System.out.println(""+transform+"涓轟駭鐢熺殑絎?+((Integer)o).intValue()+"涓腑濂栧彿鐮?);
        }else{
        temps[i]=Integer.toString(temp);
        match=match+" "+temps[i];
        if(((Integer)o).intValue()==7){
           System.out.println(""+transform+"涓轟駭鐢熺殑鐗瑰埆涓涓鍙風(fēng)爜");
        }else
        System.out.println(""+temp+"涓轟駭鐢熺殑絎?+((Integer)o).intValue()+"涓腑濂栧彿鐮?);
       }
      }
      String creat=match.substring(3);
      System.out.println("鎵浜х敓鐨勪腑濂栧彿鐮佷覆涓?"+creat);
      //System.out.println("瀵逛駭鐢熺殑涓鍙風(fēng)爜欏哄簭鎺掑簭涓?"+creats);
      Sort(temps);
      check(map,guess);
   }
   
   //瀹炵幇鎺掑簭錛屼篃鍙互璋冪敤鏂規(guī)硶錛屼絾鏄嵈蹇呴』瑕佽В鍐砎oid闂
    private static void Sort(String[] temps) {
         for(int i=0;i<temps.length;i++){
          for(int j=i+1;j<temps.length;j++){
         if(Integer.parseInt(temps[i])>Integer.parseInt(temps[j])){
            String k;
            k=temps[i];temps[i]=temps[j];temps[j]=k;
         }
        }
      }
      System.out.println("瀵逛駭鐢熺殑涓鍙風(fēng)爜欏哄簭鎺掑簭涓?");
      for(int i=0;i<temps.length;i++){
          System.out.print(temps[i]+" ");
      }
      System.out.println("\n");
    }
   
   
  //杈撳嚭緇撴灉綾誨埆  
   private static void check(Map map ,int[] guess){
        int flag=0;
         for(int i=0;i<guess.length-1;i++){
            if(map.containsValue(guess[i])){
                    flag++;
                }
         }
         if(guess[guess.length-1]==special){
            flag=flag+10;
         }
         switch(flag){
              case 16: System.out.println("鎭枩鎮(zhèn)ㄤ腑涓絳夊");break;
              case 15: System.out.println("鎭枩鎮(zhèn)ㄤ腑浜岀瓑濂?);break;
              case  5: System.out.println("鎭枩鎮(zhèn)ㄤ腑涓夌瓑濂?);break;
              case 14: System.out.println("鎭枩鎮(zhèn)ㄤ腑鍥涚瓑濂?);break;
              case 13: System.out.println("鎭枩鎮(zhèn)ㄤ腑浜旂瓑濂?);break;
              case  4: System.out.println("鎭枩鎮(zhèn)ㄤ腑浜旂瓑濂?);break;
              case  3: System.out.println("鎭枩鎮(zhèn)ㄤ腑鍏瓑濂?);break;
              default: System.out.println("璋㈣阿鍙備笌錛岀鎮(zhèn)ㄤ笅嬈′腑濂?);
         }
   }
   
   
   
  //璇存槑
 
   private static void usage(){
      System.out.println("Usage:java Randomol program [the number you guess for the lucky nums.]");
      System.out.println("\t And the nums. you must typed 7,else you will be cancel by the game rules");
      System.out.println("\t The first 6 nums is your basic nums.,the last one is your special num.");
      System.exit(0);
   }
   
   
  //涓誨嚱鏁?br>   public static void main(String []args){
        if(args.length==0||args.length>7){
              usage();
            }//甯﹀叆鍙傛暟
            int[] guess=new int[7];
            for(int i=0;i<args.length;i++){
               guess[i]=Integer.parseInt(args[i]);
            }
            //鍒ゆ柇鎵杈撳叆鐨勫彿鐮佹槸鍚︾浉鍚?br>        List <Integer> ls= new ArrayList<Integer>();
        for(int i=0;i<guess.length;i++){
           if(ls.contains(guess[i])){
              System.out.println("鎮(zhèn)ㄦ墍涔扮殑鍙風(fēng)爜涓嶅彲浠ョ浉鍚?);
              System.exit(0);
           }else  ls.add(guess[i]);
        }
        Nicky(guess);      
        System.exit(0);
   }
}

鏇插己 Nicky 2006-10-12 18:45 鍙戣〃璇勮
]]>
浠婂ぉ紿佺劧鎯沖啓浜?jiǎn)涓姌鍗婃煡鎵?/title><link>http://m.tkk7.com/wqnashqu/archive/2006/08/27/66011.html</link><dc:creator>鏇插己 Nicky</dc:creator><author>鏇插己 Nicky</author><pubDate>Sun, 27 Aug 2006 09:02:00 GMT</pubDate><guid>http://m.tkk7.com/wqnashqu/archive/2006/08/27/66011.html</guid><wfw:comment>http://m.tkk7.com/wqnashqu/comments/66011.html</wfw:comment><comments>http://m.tkk7.com/wqnashqu/archive/2006/08/27/66011.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/wqnashqu/comments/commentRss/66011.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/wqnashqu/services/trackbacks/66011.html</trackback:ping><description><![CDATA[鍛靛懙 涓嶇煡閬撳啓鐨勫浣曘備絾鏄繪劅瑙夛紝鍦║ltraEdit涓嬪啓錛岃繕鏄緢鐖界殑錛屾垨璁告槸鍥犱負(fù)瀛︽牎鍔炲叕瀹ょ殑鐢?shù)鑴戝唴瀛樺お灏忕殑缂樻晠鍚с?br> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;"> 1</span> <span style="color: #008000;">/**</span><span style="color: #008000;"><br></span><span style="color: #008080;"> 2</span> <span style="color: #008000;"> * @the author:Nicky(EN) QuQiang(CH)<br></span><span style="color: #008080;"> 3</span> <span style="color: #008000;"> * @the data :2006.8.27<br></span><span style="color: #008080;"> 4</span> <span style="color: #008000;"> *</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br></span><span style="color: #008080;"> 5</span> <span style="color: #000000;"></span><span style="color: #008000;">//</span><span style="color: #008000;"> 褰撶劧鏈畻娉曟渶濂界紪鍒舵垚涓ゅ埌3涓枃浠?/span><span style="color: #008000;"><br></span><span style="color: #008080;"> 6</span> <span style="color: #008000;"></span><span style="color: #000000;"><br></span><span style="color: #008080;"> 7</span> <span style="color: #000000;"></span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> HalfSearch{<br></span><span style="color: #008080;"> 8</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> lengthValue;<br></span><span style="color: #008080;"> 9</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">byte</span><span style="color: #000000;">  flag</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">10</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> SearchValue</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">11</span> <span style="color: #000000;">   <br></span><span style="color: #008080;">12</span> <span style="color: #000000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">瀹氫箟榪斿洖鏁扮粍綾誨瀷鐨勬柟娉?nbsp; 姝ゆ柟娉曠粰鍑虹殑public鏉冮檺</span><span style="color: #008000;"><br></span><span style="color: #008080;">13</span> <span style="color: #008000;"></span><span style="color: #000000;">    </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;">[] Sort(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">[] b){<br></span><span style="color: #008080;">14</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">b.length;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br></span><span style="color: #008080;">15</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> j</span><span style="color: #000000;">=</span><span style="color: #000000;">i</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">;j</span><span style="color: #000000;"><</span><span style="color: #000000;">b.length;j</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br></span><span style="color: #008080;">16</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> temp;<br></span><span style="color: #008080;">17</span> <span style="color: #000000;">                </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(b[i]</span><span style="color: #000000;">></span><span style="color: #000000;">b[j]){<br></span><span style="color: #008080;">18</span> <span style="color: #000000;">                    temp</span><span style="color: #000000;">=</span><span style="color: #000000;">b[i];b[i]</span><span style="color: #000000;">=</span><span style="color: #000000;">b[j];b[j]</span><span style="color: #000000;">=</span><span style="color: #000000;">temp;<br></span><span style="color: #008080;">19</span> <span style="color: #000000;">                }<br></span><span style="color: #008080;">20</span> <span style="color: #000000;">            }<br></span><span style="color: #008080;">21</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">22</span> <span style="color: #000000;">        System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u6309\u5e8f\u6392\u5217\u4e3a:</span><span style="color: #000000;">"</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">瀵瑰簲姹夊瓧涓?nbsp;    鎸夊簭鎺掑垪涓?</span><span style="color: #008000;"><br></span><span style="color: #008080;">23</span> <span style="color: #008000;"></span><span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">b.length;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br></span><span style="color: #008080;">24</span> <span style="color: #000000;">          System.out.println(b[i]);<br></span><span style="color: #008080;">25</span> <span style="color: #000000;">        }                            </span><span style="color: #008000;">//</span><span style="color: #008000;">鍐掓場(chǎng)鎺掑簭娉曟帓搴?nbsp; 鎴栫洿鎺ヤ嬌鐢吉錛わ極鎻愪緵鐨剆ort()鍑芥暟榪涜鎺掑垪</span><span style="color: #008000;"><br></span><span style="color: #008080;">26</span> <span style="color: #008000;"></span><span style="color: #000000;">        </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> b;<br></span><span style="color: #008080;">27</span> <span style="color: #000000;">    }<br></span><span style="color: #008080;">28</span> <span style="color: #000000;"><br></span><span style="color: #008080;">29</span> <span style="color: #000000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">鎶樺崐鏌ユ壘</span><span style="color: #008000;"><br></span><span style="color: #008080;">30</span> <span style="color: #008000;"></span><span style="color: #000000;">    </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> Half(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">[] a){<br></span><span style="color: #008080;">31</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> m</span><span style="color: #000000;">=</span><span style="color: #000000;">a.length,k,n</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">32</span> <span style="color: #000000;">        System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u5f53\u524d\u5171\u8f93\u5165</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">m</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">\u4e2a\u6570\u7b26</span><span style="color: #000000;">"</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">瀵瑰簲姹夊瓧涓?nbsp; "褰撳墠鍏辮緭鍏? 涓暟絎?/span><span style="color: #008000;"><br></span><span style="color: #008080;">33</span> <span style="color: #008000;"></span><span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> index</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">34</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(m</span><span style="color: #000000;">==</span><span style="color: #000000;">1</span><span style="color: #000000;">){<br></span><span style="color: #008080;">35</span> <span style="color: #000000;">           </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(a[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span><span style="color: #000000;">==</span><span style="color: #000000;">SearchValue){<br></span><span style="color: #008080;">36</span> <span style="color: #000000;">             flag</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">37</span> <span style="color: #000000;">             index</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">38</span> <span style="color: #000000;">           }<br></span><span style="color: #008080;">39</span> <span style="color: #000000;">           </span><span style="color: #0000ff;">else</span><span style="color: #000000;">{<br></span><span style="color: #008080;">40</span> <span style="color: #000000;">              flag</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">41</span> <span style="color: #000000;">              index</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">42</span> <span style="color: #000000;">           }<br></span><span style="color: #008080;">43</span> <span style="color: #000000;">        }             </span><span style="color: #008000;">//</span><span style="color: #008000;">鑰冭檻鍒扮敤鎴烽櫎杈撳叆鏌ユ壘鏁扮澶栵紝鍙緭鍏ヤ竴涓暟絎︼紝鍗硁=m=1</span><span style="color: #008000;"><br></span><span style="color: #008080;">44</span> <span style="color: #008000;"></span><span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br></span><span style="color: #008080;">45</span> <span style="color: #000000;">          </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(n</span><span style="color: #000000;"><</span><span style="color: #000000;">m){<br></span><span style="color: #008080;">46</span> <span style="color: #000000;">             index</span><span style="color: #000000;">+=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">47</span> <span style="color: #000000;">             k</span><span style="color: #000000;">=</span><span style="color: #000000;">(n</span><span style="color: #000000;">+</span><span style="color: #000000;">m)</span><span style="color: #000000;">/</span><span style="color: #000000;">2</span><span style="color: #000000;">;<br></span><span style="color: #008080;">48</span> <span style="color: #000000;">             </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(a[k</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">></span><span style="color: #000000;">SearchValue){<br></span><span style="color: #008080;">49</span> <span style="color: #000000;">                 m</span><span style="color: #000000;">=</span><span style="color: #000000;">k</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">;      </span><span style="color: #008000;">//</span><span style="color: #008000;">姝ゆ椂瀹氫箟鏈澶у間負(fù)褰撳墠涓棿鍊肩殑鍓嶄竴涓?nbsp; </span><span style="color: #008000;">//</span><span style="color: #008000;">絎?nbsp;嬈℃煡鎵炬湭鎴愬姛錛屽綋鍓嶅煎ぇ浜嶴earchValue</span><span style="color: #008000;"><br></span><span style="color: #008080;">50</span> <span style="color: #008000;"></span><span style="color: #000000;">                 System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u7b2c</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">index</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">\u6b21\u67e5\u627e\u672a\u6210\u529f\uff0c \u5f53\u524d\u503c\u5927\u4e8e</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">SearchValue);</span><span style="color: #008000;">//</span><span style="color: #008000;">鍚﹀垯灝?鏀逛負(fù)鍙橀噺</span><span style="color: #008000;"><br></span><span style="color: #008080;">51</span> <span style="color: #008000;"></span><span style="color: #000000;">             }</span><span style="color: #0000ff;">else</span><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(a[k</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;"><</span><span style="color: #000000;">SearchValue){<br></span><span style="color: #008080;">52</span> <span style="color: #000000;">                 n</span><span style="color: #000000;">=</span><span style="color: #000000;">k</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">;          </span><span style="color: #008000;">//</span><span style="color: #008000;">鏈壘鍒幫紝鍒欏湪鍚庡崐鍖洪棿榪涜鏌ユ壘  </span><span style="color: #008000;">//</span><span style="color: #008000;">灝忎簬</span><span style="color: #008000;"><br></span><span style="color: #008080;">53</span> <span style="color: #008000;"></span><span style="color: #000000;">                 System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u7b2c</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">index</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">\u6b21\u67e5\u627e\u672a\u6210\u529f\uff0c \u5f53\u524d\u503c\u5c0f\u4e8e</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">SearchValue);</span><span style="color: #008000;">//</span><span style="color: #008000;">鍚﹀垯灝?鏀逛負(fù)鍙橀噺</span><span style="color: #008000;"><br></span><span style="color: #008080;">54</span> <span style="color: #008000;"></span><span style="color: #000000;">             }</span><span style="color: #0000ff;">else</span><span style="color: #000000;">{<br></span><span style="color: #008080;">55</span> <span style="color: #000000;">                 System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u67e5\u627e\u6210\u529f</span><span style="color: #000000;">"</span><span style="color: #000000;">);  </span><span style="color: #008000;">//</span><span style="color: #008000;">鏌ユ壘鎴愬姛</span><span style="color: #008000;"><br></span><span style="color: #008080;">56</span> <span style="color: #008000;"></span><span style="color: #000000;">                 flag</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">57</span> <span style="color: #000000;">                 </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;<br></span><span style="color: #008080;">58</span> <span style="color: #000000;">             }<br></span><span style="color: #008080;">59</span> <span style="color: #000000;">           }</span><span style="color: #0000ff;">else</span><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;<br></span><span style="color: #008080;">60</span> <span style="color: #000000;">         }<br></span><span style="color: #008080;">61</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> index;<br></span><span style="color: #008080;">62</span> <span style="color: #000000;">    }                      </span><span style="color: #008000;">//</span><span style="color: #008000;">涔熷彲浠ュ畾涔変竴涓敤鎴烽渶杈撳叆鐨勬煡鎵懼?br></span><span style="color: #008080;">63</span> <span style="color: #008000;">   <br></span><span style="color: #008080;">64</span> <span style="color: #008000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">浣跨敤璇存槑</span><span style="color: #008000;"><br></span><span style="color: #008080;">65</span> <span style="color: #008000;"></span><span style="color: #000000;">   </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> usage(){<br></span><span style="color: #008080;">66</span> <span style="color: #000000;">      System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">Usage:java HalfSearch program [the number you search] [the array list you give]</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br></span><span style="color: #008080;">67</span> <span style="color: #000000;">      System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\t [the number you search] the only number you want to use it to test this program</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br></span><span style="color: #008080;">68</span> <span style="color: #000000;">      System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\t [the Array list you give] A array list may be it contains it may be not</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br></span><span style="color: #008080;">69</span> <span style="color: #000000;">      System.exit(</span><span style="color: #000000;">0</span><span style="color: #000000;">);<br></span><span style="color: #008080;">70</span> <span style="color: #000000;">   }<br></span><span style="color: #008080;">71</span> <span style="color: #000000;">      <br></span><span style="color: #008080;">72</span> <span style="color: #000000;">    </span><span style="color: #008000;">//</span><span style="color: #008000;">涓誨嚱鏁扮殑鍔熻兘  浼犲叆鏌ユ壘鏁扮粍</span><span style="color: #008000;"><br></span><span style="color: #008080;">73</span> <span style="color: #008000;"></span><span style="color: #000000;">    </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args){<br></span><span style="color: #008080;">74</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(args.length</span><span style="color: #000000;">==</span><span style="color: #000000;">0</span><span style="color: #000000;">||</span><span style="color: #000000;">args.length</span><span style="color: #000000;">==</span><span style="color: #000000;">1</span><span style="color: #000000;">){<br></span><span style="color: #008080;">75</span> <span style="color: #000000;">            usage();<br></span><span style="color: #008080;">76</span> <span style="color: #000000;">            System.exit(</span><span style="color: #000000;">0</span><span style="color: #000000;">);<br></span><span style="color: #008080;">77</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">78</span> <span style="color: #000000;">        SearchValue</span><span style="color: #000000;">=</span><span style="color: #000000;">Integer.parseInt(args[</span><span style="color: #000000;">0</span><span style="color: #000000;">]);<br></span><span style="color: #008080;">79</span> <span style="color: #000000;">        lengthValue</span><span style="color: #000000;">=</span><span style="color: #000000;">args.length;<br></span><span style="color: #008080;">80</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> index</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">81</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">int</span><span style="color: #000000;">[] TransArray</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;">[args.length</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">];<br></span><span style="color: #008080;">82</span> <span style="color: #000000;">        </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">args.length;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br></span><span style="color: #008080;">83</span> <span style="color: #000000;">            TransArray[i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #000000;">Integer.parseInt(args[i]);<br></span><span style="color: #008080;">84</span> <span style="color: #000000;">            System.out.println(TransArray[i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">]);<br></span><span style="color: #008080;">85</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">86</span> <span style="color: #000000;">        index</span><span style="color: #000000;">=</span><span style="color: #000000;">HalfSearch.Half(HalfSearch.Sort(TransArray));<br></span><span style="color: #008080;">87</span> <span style="color: #000000;">        </span><span style="color: #008000;">//</span><span style="color: #008000;">杈撳嚭鏌ヨ緇撴灉</span><span style="color: #008000;"><br></span><span style="color: #008080;">88</span> <span style="color: #008000;"></span><span style="color: #000000;">        </span><span style="color: #0000ff;">switch</span><span style="color: #000000;">(flag){<br></span><span style="color: #008080;">89</span> <span style="color: #000000;">             </span><span style="color: #008000;">//</span><span style="color: #008000;">鍦ㄦ湰嬈℃姌鍗婃煡鎵句腑鍏辯粡榪?nbsp; 嬈℃煡鎵?鏈垚鍔?nbsp;  鎴愬姛</span><span style="color: #008000;"><br></span><span style="color: #008080;">90</span> <span style="color: #008000;"></span><span style="color: #000000;">            </span><span style="color: #0000ff;">case</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">: System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u5728\u672c\u6b21\u6298\u534a\u67e5\u627e\u4e2d\u5171\u7ecf\u8fc7</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">index</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">\u6b21\u67e5\u627e,\u672a\u6210\u529f</span><span style="color: #000000;">"</span><span style="color: #000000;">);</span><span style="color: #0000ff;">break</span><span style="color: #000000;">;<br></span><span style="color: #008080;">91</span> <span style="color: #000000;">            </span><span style="color: #0000ff;">case</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">: System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">\u5728\u672c\u6b21\u6298\u534a\u67e5\u627e\u4e2d\u5171\u7ecf\u8fc7</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">index</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">\u6b21\u67e5\u627e,\u6210\u529f</span><span style="color: #000000;">"</span><span style="color: #000000;">);</span><span style="color: #0000ff;">break</span><span style="color: #000000;">;<br></span><span style="color: #008080;">92</span> <span style="color: #000000;">        }<br></span><span style="color: #008080;">93</span> <span style="color: #000000;">        System.exit(</span><span style="color: #000000;">0</span><span style="color: #000000;">);<br></span><span style="color: #008080;">94</span> <span style="color: #000000;">    }<br></span><span style="color: #008080;">95</span> <span style="color: #000000;">}</span></div> <br><br> <img src ="http://m.tkk7.com/wqnashqu/aggbug/66011.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/wqnashqu/" target="_blank">鏇插己 Nicky</a> 2006-08-27 17:02 <a href="http://m.tkk7.com/wqnashqu/archive/2006/08/27/66011.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>姹備換鎰忔鏁存暟鐨勯樁涔?/title><link>http://m.tkk7.com/wqnashqu/archive/2006/07/22/59560.html</link><dc:creator>鏇插己 Nicky</dc:creator><author>鏇插己 Nicky</author><pubDate>Sat, 22 Jul 2006 09:21:00 GMT</pubDate><guid>http://m.tkk7.com/wqnashqu/archive/2006/07/22/59560.html</guid><wfw:comment>http://m.tkk7.com/wqnashqu/comments/59560.html</wfw:comment><comments>http://m.tkk7.com/wqnashqu/archive/2006/07/22/59560.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/wqnashqu/comments/commentRss/59560.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/wqnashqu/services/trackbacks/59560.html</trackback:ping><description><![CDATA[<p>鍦↗ava涓紝鎴戜滑鍙鍒╃敤BigInteger綾伙紝鍙互瀹屾垚鍚屾牱鍔熻兘錛涜繖閲屼篃嫻嬭瘯浜?jiǎn)寮傚告互鍙?qiáng)Dialog鐨勪駭鐢熴?/p> <p>寮鍙戠幆澧冿細(xì)Windows Server 2003 Standard Edition SP1, J2SDK 1.5.0_06, Eclipse 3.1.2<br>婧愪唬鐮佸涓嬶細(xì)</p> <pre> <p>//Factorial.java<br>import java.math.BigInteger;<br>import javax.swing.*;</p> <br> <p>/**<br> * 璁$畻浠繪剰姝f暣鏁扮殑闃朵箻<br> *  <a ></a><br> * <br> */<br>public class Factorial {<br> public static void main(String[] args) {<br>  BigInteger x = BigInteger.valueOf(1); //瀛樺偍緇撴灉<br>  int num = 1; //寰呰綆楃殑鏁存暟<br>  String s = null;<br>  boolean correct = false;<br>  do {<br>   try {<br>    s = JOptionPane.showInputDialog(null, "璇瘋緭鍏ヨ璁$畻鐨勬暟(姝f暣鏁?錛?);<br>    if (s == null)<br>     break;<br>    else {<br>     num = Integer.parseInt(s);<br>     if (num < 0) <br>      throw new IllegalArgumentException();<br>     else correct = true; <br>    }  <br>   } catch (NumberFormatException e) {<br>    JOptionPane.showMessageDialog(null, "鏁版嵁鏍煎紡閿欒錛?);<br>    continue;<br>   } catch (IllegalArgumentException e) {<br>    JOptionPane.showMessageDialog(null,"璇瘋緭鍏ヤ竴涓鏁存暟錛?);<br>    continue;<br>   }<br>   break;<br>  } while (true);<br>  if (correct == true) {<br>   for (int i = 1; i <= num; i++)<br>    x = x.multiply(BigInteger.valueOf(i));<br>   JTextArea textArea = new JTextArea(x.toString(), 5, 30);<br>   textArea.setEditable(false);<br>   textArea.setLineWrap(true);<br>   Object[] object = {num + " ! : ",new JScrollPane(textArea)};<br>   JDialog dialog = new JOptionPane(object).createDialog(null,"闃朵箻鐨勭粨鏋?);<br>   dialog.setVisible(true);<br>  }<br>  System.exit(0);<br> }<br>}</p> </pre> <p> </p> <p>榪愯緇撴灉濡備笅錛?/p> <p> <img alt="" src="http://www.loujing.com/mywork/java/J2SE/20060330/1.jpg" border="0" hspace="0"> </p> <p> <img alt="" src="http://www.loujing.com/mywork/java/J2SE/20060330/2.jpg" border="0" hspace="0"> </p><img src ="http://m.tkk7.com/wqnashqu/aggbug/59560.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/wqnashqu/" target="_blank">鏇插己 Nicky</a> 2006-07-22 17:21 <a href="http://m.tkk7.com/wqnashqu/archive/2006/07/22/59560.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://922eee.com" target="_blank">国产精品免费无遮挡无码永久视频 </a>| <a href="http://ahtxjk.com" target="_blank">av无码免费一区二区三区</a>| <a href="http://gz-shunan.com" target="_blank">亚洲一级毛片视频</a>| <a href="http://holdengong.com" target="_blank">在线亚洲精品福利网址导航</a>| <a href="http://nmgqsyg.com" target="_blank">毛片视频免费观看</a>| <a href="http://shaolingtongluo.com" target="_blank">久久国产乱子伦精品免费看</a>| <a href="http://wwwaa875.com" target="_blank">一级毛片免费不卡</a>| <a href="http://83k5.com" target="_blank">亚洲av第一网站久章草</a>| <a href="http://ax445.com" target="_blank">亚洲一区二区三区无码国产</a>| <a href="http://chandou8.com" target="_blank">亚洲avav天堂av在线不卡 </a>| <a href="http://chuoche.com" target="_blank">日本黄页网址在线看免费不卡</a>| <a href="http://hztkw.com" target="_blank">国产成人精品亚洲2020</a>| <a href="http://miya77772.com" target="_blank">亚洲丝袜美腿视频</a>| <a href="http://kkjk123.com" target="_blank">亚洲日韩av无码</a>| <a href="http://kk600700.com" target="_blank">久久亚洲国产精品五月天婷</a>| <a href="http://juguanghr.com" target="_blank">又粗又硬免费毛片</a>| <a href="http://xmmn77.com" target="_blank">国产麻豆免费观看91</a>| <a href="http://www-741.com" target="_blank">久久久久久国产精品免费免费</a>| <a href="http://qq2071.com" target="_blank">99在线观看精品免费99</a>| <a href="http://6t23.com" target="_blank">久久精品视频免费</a>| <a href="http://ynrygc.com" target="_blank">成人免费无码H在线观看不卡</a>| <a href="http://t66p.com" target="_blank">亚州**色毛片免费观看</a>| <a href="http://71caoxee.com" target="_blank">羞羞视频网站免费入口</a>| <a href="http://selaohu.com" target="_blank">久久水蜜桃亚洲AV无码精品</a>| <a href="http://ebhqd.com" target="_blank">精品韩国亚洲av无码不卡区</a>| <a href="http://www-70074.com" target="_blank">亚洲日韩一区二区三区</a>| <a href="http://8x6c.com" target="_blank">亚洲伊人久久大香线蕉AV</a>| <a href="http://yzxjk.com" target="_blank">亚洲AV成人噜噜无码网站</a>| <a href="http://ycjs999.com" target="_blank">va天堂va亚洲va影视中文字幕</a>| <a href="http://wwwbu610.com" target="_blank">亚洲精品白色在线发布</a>| <a href="http://www-774220.com" target="_blank">2022年亚洲午夜一区二区福利 </a>| <a href="http://48eh.com" target="_blank">中文字幕免费在线看电影大全</a>| <a href="http://zf91.com" target="_blank">黄色视频在线免费观看</a>| <a href="http://szybzc.com" target="_blank">一级特黄a免费大片</a>| <a href="http://0515zs.com" target="_blank">丁香花在线观看免费观看图片</a>| <a href="http://haohaoshuo.com" target="_blank">亚洲国产免费综合</a>| <a href="http://ningxialanh.com" target="_blank">国产vA免费精品高清在线观看</a>| <a href="http://lanoss.com" target="_blank">中文字幕版免费电影网站</a>| <a href="http://0755szyxcm.com" target="_blank">成年免费a级毛片免费看无码</a>| <a href="http://61255555.com" target="_blank">三级毛片在线免费观看</a>| <a href="http://xin-matai.com" target="_blank">国产色爽免费无码视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>