#178. 检查分数是否递增
检查分数是否递增
Check Non-Decreasing Scores
Background
Congcong is currently organizing some competition score records. He wants to know if these scores consistently show an improving trend, meaning each competition's score is greater than or equal to the previous one.
Problem Description
Given an array of scores, return true if each score is equal to or greater than the one before. The array will be length 2 or more.
Input Format
The input is given from standard input in the following format.
The first line contains several space-separated integers, representing all scores in the array.
Output Format
The output should be printed to standard output in the following format.
Output
trueif the array of scores is non-decreasing; otherwise, outputfalse.
Sample
1 3 4
true
1 3 2
false
1 1 4
true
Sample Explanation
Sample 1: The array is [1, 3, 4]. and . All scores satisfy the non-decreasing condition, so true is output.
Sample 2: The array is [1, 3, 2]. Although , . The non-decreasing condition is not met, so false is output.
Sample 3: The array is [1, 1, 4]. and . All scores satisfy the non-decreasing condition, so true is output.
Constraints
For each test case:
- Time limit: 1 second
- Memory limit: 1024 KiB
- The length of the score array satisfies .
- Each score in the array satisfies .