Like Tree4Likes
  • 1 Post By Salem
  • 1 Post By rags_to_riches
  • 1 Post By Salem
  • 1 Post By rogster001

how ı can do it in c++ ?

This is a discussion on how ı can do it in c++ ? within the C++ Programming forums, part of the General Programming Boards category; When user enters ‘C’ or ‘c’ program wants from the user to enter an integer numbers which are between 1 ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    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.
    rags_to_riches likes this.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,650
    Where's that tumbleweed gif you posted the other day?
    Salem likes this.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    Name:  tumbleweed_.gif
Views: 69
Size:  16.9 KB
    rags_to_riches likes this.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,425
    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 01:33 PM.
    GReaper likes this.
    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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21