Thread: loop building question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    No, that's not what my code does. It orders the row putting the greatest value (that is less than the previous diagonal value) into the diagonal. Look at my output again.

    Code:
     8 6 6 1
     5 4 3 6
     5 1 2 3
     4 2 4 1
    
     8 4 6 1
     5 6 2 6
     5 1 4 1
     4 2 3 3
    The two things you'll have to add for checks is: One, you have to make sure there isn't a higher value in the diagonal initally before the swap. Two, you have to make sure each column has at least one value lower than the preceding column.
    Last edited by SlyMaelstrom; 11-30-2005 at 11:27 PM.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. For loop question
    By JuzMe in forum C++ Programming
    Replies: 11
    Last Post: 04-20-2009, 08:39 AM
  2. Loop question
    By kwood965 in forum C Programming
    Replies: 6
    Last Post: 10-29-2008, 11:12 PM
  3. simple for loop function question
    By felicityxiv in forum C Programming
    Replies: 7
    Last Post: 05-06-2006, 11:43 PM
  4. Please don't laugh...SIMPLE loop question!
    By the_lumin8or in forum C++ Programming
    Replies: 5
    Last Post: 03-31-2006, 01:08 PM
  5. while loop question
    By rayrayj52 in forum C++ Programming
    Replies: 2
    Last Post: 10-19-2004, 05:13 PM