PWAD - Plus Within a diamond

no tags 

Write a program that prints a diamond with a plus within it, given the integer height of the diamond.
The outer-most shape is a normal diamond shape, the middle row of the shape will be a row filled with stars (making the horizontal dash of the plus sign), and in all the remaining rows the middle element of that row will have a star (making the vertical dash of the plus sign).
Observe the following examples:

For n=11, the output will look like:

     *
    ***
   * * *
  *  *  *
 *   *   *
***********
 *   *   *
  *  *  *
   * * *
    ***
     *

For n=7, the output will look like:

   *
  ***
 * * *
*******
 * * *
  ***
   *

For n=3, the output will look like:

 *
***
 *

For n=1, the output will look like:

*

Only consider odd sizes.


hide comments
(Tjandra Satria Gunawan)(曾毅昆): 2013-04-13 20:58:34

solved using brainf**k ;-)
btw, this problem has an issue: This problem isn't using exact judge, e.g. for n=11 print: "* *** * * * * * * * * * *********** * * * * * * * * * *** *" is accepted! I think it's better if someone fix this issue..

--ans(francky)-->Issue collected, I can't act on this. But I'll edit the body with some 'pre' and less 'bold'...
Thanks.

Last edit: 2013-04-13 21:13:39
Miro Opiela: 2013-02-19 11:09:49

there is just one test case

MR. BEAN : 2012-04-04 10:39:40

move it to tutorial :)

rohitjv: 2012-04-03 13:35:35

tutorial

Better late than never !!!: 2012-03-31 19:38:39

move it to tutorial....

Neeraj Bhat: 2012-03-31 15:40:27

getting correct on my system. still WA...
why?

I_AM: 2012-03-30 08:06:22

This Does Not Deserve to be in the Classical Problems List. Please Move This to Tutorial...NOW!!

:D: 2012-03-30 08:06:22

REALLY must be moved to tutorial. There's nothing problematic here. Maybe using proper output routine, but that also makes a tutorial task.

Adhityaa: 2012-03-30 08:06:22

At least open for all the major languages (C, C++, Pascal etc.)

Ahmed AKram: 2012-03-30 08:06:22

xD


Added by:Mussab ElDash
Date:2012-03-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:GUC CSEN202 2012 Assignment