Thread: how ı can do it in c++ ?

  1. #1
    Registered User
    Join Date
    Nov 2012
    Location
    Eskişehir, Turkey
    Posts
    1

    how ı can do it in c++ ?

    When user enters ‘C’ or ‘c’ program wants from the user to enter an integer numbers
    which are between 1 and 20. (1≤n≤20). Then the program prints a circular nxn matrix
    as in the following form:
    n n-1 n-2 … 3 2 1
    1 n n-1 … 4 3 2
    2 1 n … 5 4 3
    … … … … … … …
    n-3 n-4 n-5 ... n n-1 n-2
    n-2 n-3 n-4 … 1 n n-1
    n-1 n-2 n-3 … 2 1 n
    For example if user enters 5 then the message will be like the following:BIL-200 GROUP A,B,C HOMEWORK PROJECT 3 07/11/2012
    3
    5 4 3 2 1
    1 5 4 3 2
    2 1 5 4 3
    3 2 1 5 4
    4 3 2 1 5
    For example if user enters 3 then the message will be like below:
    3 2 1
    1 3 2
    2 1 3

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Announcements - C++ Programming
    Post your attempt, then we'll help.

    This isn't a place where you can dump your assignment and get an answer in response.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Where's that tumbleweed gif you posted the other day?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    how ı can do it in c++ ?-tumbleweed_-gif
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    you just do it like this:

    Code:
    #include "MagicPixieHelpers.h"
    
    
    int main()
    {
    
    MagicHomeworkPixie* mhpixie= new MagicHomeworkPixie;
    bool exists = false;
    bool willTry = false;
    
      if(exists)
      {
           mhpixie->DoMyHomework();
      }
      else
          willTry = true;
      
      return(LearningToProgram(willTry));
    }
    Last edited by rogster001; 11-12-2012 at 02:33 PM.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

Popular pages Recent additions subscribe to a feed

Tags for this Thread