hello 51cto

今日學習:

day01:

1.第一項


2.第二項


<dependencies>
 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
    <version>2.0.0.RELEASE</version>
 </dependency>
 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <version>2.0.0.RELEASE</version>
    <optional>true</optional>
  </dependency>
</dependencies>

<br>

冒泡排序


/**
 * @anthor shkstart
 * @create 2020-03-19-15:33
 */
public class Test1 {
    public static void main(String[] args) {

        int[] arr = new int[]{
                65,98,34,16,0,-5,-6,45,39,-44,-99,35,34
        };

        //外層控制排序的對比的次數,比數組長度少1是因爲最後一個數據不用比
        for (int i = 0; i < arr.length; i++) {
            //-i 是因爲排序導最後可以得出一個最大值,就不用參與排序了
            for (int j = 0; j < arr.length-1-i; j++){
                //比較相鄰的兩個元素。如果第一個元素比第二個元素打,就交換位置
                if (arr[j] > arr[j + 1]){
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }

        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "\t");
        }

    }
}

java
c
c++

mikas

這個是粗體

meirifuxijihua


  • 1
  • 23

    1. a
  1. b
  2. c
  3. d
  4. e

baidu~

123 2 Column 3
Text Text Text

第一次使用``

123
234~~


sout system.out.print

/d

123

123

123

1234

1234

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章