Help me with my code, please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help me with my code, please.

My code works not correctly. Cyclic shift of the array to the left by R elements. The size of R does not exceed the length of the array N The first line contains the size of the array N . The second line contains n space-separated numbers-array elements. It is guaranteed that 0 < N ≤ 10000 . The third line contains the number R (0 ≤ R ≤ N ). Output The program should print in one line all the elements of the resulting array, separated by spaces. https://code.sololearn.com/cWNYdvaTNwj0/?ref=app https://code.sololearn.com/cWNYdvaTNwj0/?ref=app

17th Dec 2018, 12:51 PM
Иван
3 Answers
+ 1
you forgot to initialize the indexer "r" in second for loop
17th Dec 2018, 1:26 PM
MO ELomari
+ 1
you haven't given r a value int r; is not the same as assigning r a value of 0 You should do: int r = 0
17th Dec 2018, 1:40 PM
MO ELomari
+ 1
Thanks!
17th Dec 2018, 1:40 PM
Иван