Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaʵÏÖµÄðÅÝÅÅÐò

ðÅÝÅÅÐòÊÇÒ»ÖÖºÜÁ÷Ðкܼòµ¥µÄÅÅÐòËã·¨£¬ËüÖظ´µÄ½»»»ÏàÁÚÁ½¸ö·´ÐòÔªËØ¡£
import java.util.Date;
import java.util.Random;
public class BubbleSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int data[]=new int[len];
for(int i = 0; i < len; i++)
{
data[i]=(int)(random.nextFloat()*100+1);
}
System.out.println("Select sort:");
show(data);
bubbleSort(data);
show(data);
}
/*
* ðÅÝÅÅÐò
*/
private static void bubbleSort(int[] data)
{
int len=data.length;
for(int i=len; i>=1; i--)
{
for(int j=0; j<i-1 ; j++)
{
if(data[j+1]<data[j]){
int temp=data[j+1];
data[j+1]=data[j];
data[j]=temp;
}
}
}
}
private static void show(int[] data)
{
System.out.println("========================");
for(int i = 0; i < data.length; i++)
{
System.out.print(data[i] + " ");
}
System.out.println();
System.out.println("========================");
}
}


Ïà¹ØÎĵµ£º

Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ


0
Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ
Posted in ˶²©ÂÛÎÄ at ʮһÔ 12th, 2009 / No Comments »
Íõ࣬ÖÜÀ¼½­£¬ÁõÀñ¶«£¬½âÔÆÏö
(À¥Ã÷Àí¹¤´óѧÐÅÏ¢¹¤³ÌÓë×Ô¶¯»¯Ñ§Ôº£¬ÔÆÄÏÀ¥Ã÷650051)
1ÒýÑÔ
Ëæ×ÅÍøÂçÐÅÏ¢¼¼ÊõµÄ·ÉËÙ·¢Õ¹£¬Web¼¼ÊõÔ½À´Ô½¶àµÄÓÃÔÚ¿ØÖÆÁìÓò£¬¿Í»§¶ËÖ»ÐèÁ¬½ÓÒÔÌ«Íø£¬È¡µÃ·ÃÎÊȨÏÞ£¬¾Í¿ÉÒÔ·Ã ......

ÔõÑù²é¿´Jsp±àÒëºóÉú³ÉµÄJavaÎļþ

      ¿ÉÄÜ´ó¶àÊýJsp¿ª·¢Ô±ÔÚдÍê³ÌÐò²âÊÔͨ¹ýºó£¬²»Ì«»á¹Ø×¢JspÉú³ÉµÄJavaÎļþ£¬Æäʵ£¬Í¨¹ýJava´úÂ룬¸üÄÜÌåÏÖ³ÌÐò´úÂëµÄÕæÕýº¬Ò壬¶Ô½øÒ»²½Ñо¿³ÌÐò´úÂëµÄºǫ́ÔËÐÐÇé¿öÊǷdz£ÓаïÖúµÄ¡£ÀýÈ磬ÓÃJsp±àд´úÂëʱ£¬ÓÐʱºòÓÃ<%!   %>£¬ÓÐʱºòÓÃ<%   %>£¬¼Ó²»¼Ó¸Ð̾º ......

java GBת UTF 8×Ö·û

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GB2UTF
{
 public static String GBK2Unicode(String str)
 {
  StringBuffer result = new StringBuffer();
  for (int i = 0; i < str.length(); i++)
 &n ......

ÓÃjavaʵÏֵĵü´úºÍµÝ¹é²åÈëÅÅÐò

ÏÂÃæʹÓÃÒ»¸öjavaʵÏֵĵü´ú°æµÄµÝ¹é°æµÄ²åÈëÅÅÐò¡£
package sort;
import java.util.Date;
import java.util.Random;
/*
* ²åÈëÅÅÐò
*/
public class InsertSort{
public static void main(String args[])
{
int len = 20;
Date date = new Date();
Random random = new Random(date.getSeconds()); ......

javaʵÏÖµÄÑ¡ÔñÅÅÐò

ÏÂÃæÊÇÓÃjavaʵÏÖµÄÑ¡ÔñÅÅÐò£¬Ã¿´Î´ÓÊý×éÖÐÑ¡È¡×îСµÄÖµ£º
import java.util.Date;
import java.util.Random;
/*
* Ñ¡ÔñÅÅÐò
*/
public class SelectSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ