<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          面試:手寫個(gè)冒泡排序吧

          共 859字,需瀏覽 2分鐘

           ·

          2021-06-12 11:41

          01
          了解冒泡排序嗎?那手寫一個(gè)

          public class Sort {  public static void sort() {    Scanner input = new Scanner(System.in);    int sort[] = new int[10];    int temp;    System.out.println("請(qǐng)輸入10個(gè)排序的數(shù)據(jù):");    for (int i = 0; i < sort.length; i++) {      sort[i] = input.nextInt();    }    for (int i = 0; i < sort.length - 1; i++) {      for (int j = 0; j < sort.length - i - 1; j++)       {        if (sort[j] < sort[j + 1]) {          temp = sort[j];          sort[j] = sort[j + 1];          sort[j + 1] = temp;        }      }    }    System.out.println("排列后的順序?yàn)椋?);    for(int i=0;i<sort.length;i++){      System.out.print(sort[i]+"   ");    }  }  public static void main(String[] args) {    sort();  }}
          Java倉庫
          一個(gè)拿來就能用的公眾號(hào)
          微信掃描二維碼,關(guān)注我的公眾號(hào)
          瀏覽 27
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  午夜靠逼| 人人操永久网 | 欧美性爱免费在线视频 | 青青草视频在线视频 | 亚洲操逼片 |