rotate array


Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
Java 19, Java 8

題目說明

輸入五個整數並放入陣列,及一個正整數k,將陣列向右旋轉 k 步。輸出旋轉後的陣列。

輸入限制: 整數(int) 輸入範圍: -10000 到 10000,k為正整數

輸入

五個整數 正整數k

輸出

旋轉後的陣列

sample input1

1 2 3 4 5 2

sample output1

4 5 1 2 3

sample input2

1 4 7 5 8 3

sample output2

7 5 8 1 4

Comments

There are no comments at the moment.