Alguém pode me ajudar com o erro "Index was outside the bounds of the array" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Alguém pode me ajudar com o erro "Index was outside the bounds of the array"

https://code.sololearn.com/ca1xbqLZRx7y/?ref=app

11th Mar 2018, 3:49 PM
Manoel
Manoel - avatar
2 Answers
+ 3
Try running the loop from 0 to n-1 instead of n. Thus, the loop looks like : for(int i=0;i<n;i++) { } Secondly, remove the semicolon after the loop to get the code below it to run.
11th Mar 2018, 4:51 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
okay, thanks
11th Mar 2018, 4:57 PM
Manoel
Manoel - avatar