C Primer Plus 第六章第四題

4. Have a program request the user enter an uppercase letter. Use nested loops to produce a pyramid pattern like this:


The pattern should extend to the character entered. For example, the preceding pattern would result from a input value of E. Hint: Use an outer loop to handle the rows. Use three inner loops in a row, one to handle the spaces, one for printing letters in ascending order, and one for printing letters in descending order.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.