Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * * 1 votes

Sprial matrix proble

matrix spiral

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 fredex

fredex

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 12 November 2015 - 01:12 PM

I'm stuck with this task. Been trying to figure it out for 2 weeks now already and i always get stuck in the part when the spiral is going on a second lap.

I'm trying to write a program that takes amout of rows and amount of colums from user output and turns it into spiral matrix.

Example:
Enter amout of rows: 5
Enter amount of colums: 5

 

11111
45552
48962
47762
33332

I've figured out a way how to print numbers in spiral order from square matrix, but haven't figured it out yet the other way around.
All the ideas are appreciated.

F






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download