CCC '01 J1 - Dressing Up

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Canadian Computing Competition: 2001 Stage 1, Junior #1

It is important to keep our computers safe and clean. Some people feel that computers should be well-dressed, also. For this question, you will write a program to print out a bow tie on the computer screen.

Your program should take as input the height H of the bow tie, where H is an odd positive integer greater than or equal to 5. A bow tie with H rows (and 2H columns) should then be printed using the pattern shown below in the sample output.

Input Specification

One line containing integer H. You may assume that all input data will be valid.

Sample Input 1


Sample Output 1

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

Sample Input 2


Sample Output 2

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


  • -3
    350023289  commented on July 9, 2019, 8:35 p.m.


  • -4
    Arihan10  commented on Dec. 8, 2018, 8:17 p.m.

    I have tested my code, it works properly, but on this website, I get WA three times in a row. Does anyone know why?

  • 2
    Medi  commented on Oct. 12, 2016, 8:01 p.m.

    When I test my code off of the website, it displays the proper output, yet when it's published to the website, I get WA three times in a row. Does my output have to be printed all at once, or can each line be printed separately? I'm not sure if that is the problem.

    • 9
      Xyene  commented on Oct. 12, 2016, 8:32 p.m.

      You're printing an extra blank line both before the bowtie and after.