2002 Canadian Computing Competition, Stage 1

Problem J1: 0123456789

Most digital devices show numbers using a seven segment display. The seven segments are arranged as shown:

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

For this problem each segment is represented by three asterisks in a line as shown above. Any digit from 0-9 can be shown by illuminating the appropriate segments. For example the digit 1 may be displayed using the two segments on the right side:

      *
      *
      *
     
      *
      *
      *

The digit 4 needs four segments to display it properly:

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

Write a program that will accept a single digit input from the user, and then display that digit using a seven segment display. You may assume that each segment is composed of three asterisks.

Sample Input

9

Sample Output

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

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 01, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

Whats the point of this question? Hardcoding skills?

the 1st test case doesn't work, what does it mean by clipped? How to fix?

Clipped means that the judge doesn't show all of your output. It will only show a few lines of output. Your output is just wrong(try checking if it exactly matches the output)

My third test case is saying that it is wrong, please can anybody help me!
My problem is that in the test case it is show some weird clipped area. Can someone help me ?

The output shown will always be clipped.

I believe that my code worked, but apparently not...

Look at the segments at the top of the problem statements and compare how those segments look to how your program prints them.


Spaces?

Yes, make sure spaces are present between the asteriks going horizontal.