for(int i = x; i < s; i++) {
Check your latter iterations: s is less than x, so i gets initialized higher than s, and the loop never executes.
0
solved C++ Loop Skips After First Run
for(int i = x; i < s; i++) {
Check your latter iterations: s is less than x, so i gets initialized higher than s, and the loop never executes.
0
solved C++ Loop Skips After First Run