Problem1370--判断升序

1370: 判断升序

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

实现public static boolean isSorted(int[] table)
判断整数数组元素是否已经按升序排序。

Input

一列数,需要判断的数组元素。

Output

如果已经排序输出YES
如果没有排序输出NO

Sample Input Copy

1
2
3
4
5
6

Sample Output Copy

YES

HINT

import java.util.*;
public class Main{
   public static void main(String args[]){
  Scanner cin = new Scanner(System.in);
  int a, b;
  b=-1;
  while (cin.hasNext()){
  a = cin.nextInt();
              if(??????????){
                ????????;
               ????????????????????;
              }
 ????????????;
                        }
 if(!cin.hasNext())
  ????????????????????????
  }
}


Source/Category