¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
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
3 Respuestas
+ 1
you forgot to initialize the indexer "r" in second for loop
+ 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
+ 1
Thanks!