This content has been marked as final. Show 4 replies
You can't use k to do the counting for the most inner loop. The most inner loop needs to run 10 times and ALSO needs to calculate a value to display as 'k'. This value starts at 1 and then increases 'j' with each iteration, never going over 10.
You're almost there, now think about it a little more and finish this sucker yourself. Don't rob yourself of the eureka moment where you figure it out all on your own - that feeling (plus the satisfaction of actually finishing something) is what makes programming fun.
I already used three loops and I think the loop using the variable i is unnecessary. I have sought for help to this pattern after trying for myself many times, but no use. I request anyone who knows the answer to post the solution.
I think the problem would much more clear if you would describe in English (not code) what rules the output should follow. I can't tell what the desired outcome is based on the code & your vague description. The sample output was not helpful to me.
Assuming your data has no defined algorithm and is finite in length, how about sticking all the numbers in a (static) three dimensional array, then reading the array? There is no algorithm involved.