if input : 5
output :
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
I don't think aakashjohari meant that, but wants a way to display a numeric spiral with any input, that will work just for fixed input.
thank you chu121su12......
i hope you will help me in future in this way
I was just excited about this question. Usually, I got the the triangle stuff and I don't have any idea on any simple-complex advancement. Your question was interesting enough to make me think beside my other codes.
This should be my thank.
This is an another problem chu121su12, which i have sent in this forum.....
suppose input is a triangle as follows-
2
3 4
6 1 9
3 4 8 3
7 2 4 3 1
i am to choose a path from top to botttom so that the sum of the numbers in this path should be maximum. i can move only left or right of the number when coming to the next row. as i am at then i can move only to 3 or 4. if i move to 4 then in next chance i can move to 1 or 9. in this way i will go to bottom. this program only should answer the maximum sum.
Thanx!!!!!!