+ 1

Need help getting this but can you guys provide me some peuedo code and some guidance . I want to do it myself but need help 😅

5 4 3 2 1 4 3 2 1 3 2 1 2 1 1

10th Oct 2018, 1:26 PM
partha
partha - avatar
2 Respostas
+ 3
Looks like you need to have loops. One that iterates through the integers in the line and another, that iterates through the lines themselves. Due to the fact that you have integers changing in a line, you probably will need those loops nested. Like, you get an integer, get a range with this integer and iterate it line by line, and in every line you iterate it number by number. In general: 1. take the source integer (5) 2. make a for-loop with its range in reverse order (because you need a "countdown") 3. Every loop start an inner for-loop to print current value of source integer - with a range in reverse order. That's it.
10th Oct 2018, 2:01 PM
strawdog
strawdog - avatar
0
strawdog I'll try and let you know if I succeed
10th Oct 2018, 2:27 PM
partha
partha - avatar