?? bubblesort.java
字號:
public class BubbleSort{
public static void main( String args[ ] ){
int i,j;
int a[ ]={30,1,-9,70,25};
int n=a.length;
for( i=1; i<n; i++)
for( j=0; j<n-i; j++ )
if( a[j]>a[j+1]){
int t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
for( i=0; i<n; i++ )
System.out.println(a[i]+" ");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -