#77. 创建递增序列数组
创建递增序列数组
Create Increasing Array
Background
This problem asks you to implement a basic array creation function.
Problem Description
Given an integer , create and return a new integer array of length , containing the numbers . The given may be , in which case just return a length array. You do not need a separate if-statement for the length- case; the for-loop should naturally execute times in that case, so it just works. The syntax to make a new integer array is: new int[desired_length].
Input Format
Input is given from standard input in the following format.
n
Output Format
Output is printed to standard output in the following format.
[0, 1, ..., n-1]
Sample
4
[0, 1, 2, 3]
1
[0]
10
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Sample Explanation
For Sample 1, given , the output is an array containing . For Sample 2, given , the output is an array containing . For Sample 3, given , the output is an array containing numbers from to .
Constraints
Time limit: second, Memory limit: KiB for each test case.