27th Aug 2017, 2:29 PM
LOST FREQUENCIES
5 odpowiedzi
+ 2
https://code.sololearn.com/cLTGugnkSx57/?ref=app I'd do it this way
27th Aug 2017, 3:18 PM
Zeke Williams
Zeke Williams - avatar
+ 2
x is used as variable twice, so it's an error...
27th Aug 2017, 2:31 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 1
It's called a 'for-each' loop. They are extremely useful for iterating over arrays and strings, because you don't have to know how many elements are in the container you are looping over; the for-each loop does that for you. You can learn more here: http://en.cppreference.com/w/cpp/language/range-for And here: http://www.learncpp.com/cpp-tutorial/6-12a-for-each-loops/
27th Aug 2017, 3:55 PM
Zeke Williams
Zeke Williams - avatar
+ 1
Thanks for your help Zeke.
27th Aug 2017, 4:29 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
0
hey zeke what's that for loop you used called. And where can I learn more about it?
27th Aug 2017, 3:26 PM
Rishabh Agrawal
Rishabh Agrawal - avatar