Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 3 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 5.00

serial format

The problem which arises with the usual printing devices is that they print only in serial format. They start printing or displaying text from the left most character and proceed towards right to display a line. Due to this it is difficult to print different formats of data and the design patterns efficiently on screen.

Your task is to print a matrix of order n*n with numbers from 1 to n2 in a spiral format. In this format the entry of numbers start from center of the matrix and the filling is proceeded in the anticlockwise direction. The ending cell for even values of n is the first cell (1, 1) and for the odd values of n is the last cell (n, n) of the matrix.

Input

The input consists of a single number n such that 0

Output

The output consist of an n*n matrix filled in spirally anticlockwise direction.

Example 1

Input: 4 Output: 16 15 14 13 5 4 3 12 6 1 2 11 7 8 9 10

Example 2

Input: 5 Output: 17 16 15 14 13 18 5 4 3 12 19 6 1 2 11 20 7 8 9 10 21 22 23 24 25

Answers

(5)
Status NEW Posted 17 Sep 2017 05:09 AM My Price 5.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)