title: java - Selection Sort
body: <p>I want to implement a selection alignment that receives 10 integers and organizes them in ascending order.</p>
  <p>However, when my code is operated, other things work normally, but only the first integer is not aligned.</p>
  <p>Please let me know how to fix the code.</p>
  <pre><code>public static void sort(int[] array) {
      Scanner sc = new Scanner(System.in);
      System.out.println(&quot;put the int&quot;);
      
      for (int i =0;i &lt;array.length;i++) {
          System.out.print((i+1)+&quot;: &quot;);
      int n = sc.nextInt();
          array[i] = n;
          for (int j = 1; j &lt; array.length;j++) {
              if (array[i] &lt; array[j]) {
                  
                  int temp = array[i];
                  array[i] = array[j];
                  array[j] = temp;
              }
          }
      }
      
      for (int a=0; a&lt; array.length; a++) {
          System.out.print(array[a]+&quot; &quot;);
  
      }
  }
  public static void main(String[] args) {
      int[] my_array = {0,0,0,0,0,0,0,0,0,0};
      sort(my_array);
  }
  </code></pre>
  <p>}</p>