#178. 检查分数是否递增

    ID: 178 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatAp-1gesp1循环结构条件结构

检查分数是否递增

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 true if the array of scores is non-decreasing; otherwise, output false.

Sample

1 3 4
true
1 3 2
false
1 1 4
true

Sample Explanation

Sample 1: The array is [1, 3, 4]. 131 \le 3 and 343 \le 4. All scores satisfy the non-decreasing condition, so true is output.

Sample 2: The array is [1, 3, 2]. Although 131 \le 3, 3≰23 \not\le 2. The non-decreasing condition is not met, so false is output.

Sample 3: The array is [1, 1, 4]. 111 \le 1 and 141 \le 4. 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 NN satisfies 2N1002 \le N \le 100.
  • Each score SiS_i in the array satisfies 0Si10000 \le S_i \le 1000.