Здравейте! Решавах задачата във VS Code и ми се компилира правилно, но judge ми дава 0/100.
Description
Write a program that allocates array of N integers, initializes each element by its index multiplied by 5
and the prints the obtained array on the console.
Input
- On the only line you will receive the number N
Output
- Print the obtained array on the console.
- Each number should be on a new line
Constraints
- 1 <= N <= 20
- N will always be a valid integer number
Sample tests
Input | Output |
---|---|
5 | 0 |
5
10
15
20|
Това е кодът ми:
let input=[‘5’]
let print = this.print || console.log;
let gets = this.gets || ((arr, index) => () => arr[index++]);
let myArr=+gets();
for(let i=0; i<myArr.length; i++){
myArr[i]=i*5;
}
for(let i=0; i<myArr.length; i++){
print(myArr[i]);
}
Благодаря предварително!