今日學習:
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
這個是粗體
- 1
- 23
-
- a
- b
- c
- d
- e
123 | 2 | Column 3 |
---|---|---|
Text | Text | Text |
第一次使用``
123
234~~
sout system.out.print
/d