lundi 27 avril 2020

Making a diamond with a line in the middle c#

So I need to make a program that will print out a diamond shape with a line in the middle, the side is equal to the line, and the user inputs that value. I've tried to do it but can I can only print out a diamond without the line, or to make it in pieces, one hollow pyramid and one inverted hollow pyramid, but with that, I get a shape with 2 lines in the middle, any help is crucial!

example: input 5

output:

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

Aucun commentaire:

Enregistrer un commentaire