title: Sequence of integer (in ascending or descending order)
body: <p>A sequence of whole numbers, check if it is ordered <code>true</code> (in ascending or descending order), otherwise it is <code>false</code>. If a number has the same value as the number below, it will not break the order. The sequence ends with <code>0</code>.</p>
  
  <pre><code>Sample Input 1: 9 8 7 6 5 4 3 2 1 0
  Sample Output 1:true
  --------------------------------
  Sample Input 2: 1 2 3 3 9 0
  Sample Output 2:true
  --------------------------------
  Sample Input 3: 1 2 5 5 2 3 0
  Sample Output 3: false
  --------------------------------
  </code></pre>
  
  <p>I need help, I've been trying for days ... I really appreciate any help ...</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Main {
      public static void main(String[] args) {
          Scanner s = new Scanner(System.in);
          int a = 0;
          while (s.hasNextInt()) {
              int i = s.nextInt();
              a = i;
              if (i &lt; a) {
                  if (i &lt; a) {
                      System.out.println("true");
                  } else if (i &gt; a) {
                      System.out.println("false");
                      break;
                  }
              } else if (i &gt; a) {
                  if (i &gt; a) {
                      System.out.println("true");
                  } else if (i &lt; a) {
                      System.out.println("false");
                      break;
                  }
              } else if (i == a) {
              }
          }
      }
  }
  </code></pre>