知識社群Login
[程式練功區]C程式-Homework1
by 艾鍗學院, 2012-03-24 22:13, Views(2046)
Write  a  program  that  prints the  following  diamond  shape.  Your  program  should 
read  an  odd  number  in  the  range  1  to  51  to  specify  the  number  of  rows  in  the diamond, and then display a diamond of the appropriate size.   
You  may  use  output  statements  that  print  either  a  single  asterisk  (*) or  a  single blank. Maximize your use of repetition (with nested for statements) and minimize the number of output statements.

        *
       ***
      *****
     *******
    *********
   ***********
    *********
     *******
      *****
       ***
        *
Discussion
No.TitleRepliesLikeModified
11316
2
0