관리 메뉴

드럼치는 프로그래머

[M2S] 2009년 01월 29일 목요일 C언어 DailyQuiz 11 ( LC-Display ) 본문

★─M2S Study/☆─09.01 Daily

[M2S] 2009년 01월 29일 목요일 C언어 DailyQuiz 11 ( LC-Display )

드럼치는한동이 2009. 1. 28. 07:39


A friend of you has just bought a new computer. Until now, the most powerful computer he ever used has been a pocket calculator. Now, looking at his new computer, he is a bit disappointed, because he liked the LC-display of his calculator so much. So you decide to write a program that displays numbers in an LC-display-like style on his computer.

Input

The input file contains several lines, one for each number to be displayed. Each line contains two integers s, n (

), where n is the number to be displayed and s is the size in which it shall be displayed.

The input file will be terminated by a line containing two zeros. This line should not be processed.

Output 

Output the numbers given in the input file in an LC-display-style using s ``-'' signs for the horizontal segments and s ``|'' signs for the vertical ones. Each digit occupies exactly s+2 columns and 2s+3 rows. (Be sure to fill all the white space occupied by the digits with blanks, also for the last digit.) There has to be exactly one column of blanks between two digits.

Output a blank line after each number. (You will find a sample of each digit in the sample output.)

Sample Input 


2 12345
3 67890
0 0

Sample Output 

      --   --        -- 
   |    |    | |  | |   
   |    |    | |  | |   
      --   --   --   -- 
   | |       |    |    |
   | |       |    |    |
      --   --        -- 

 ---   ---   ---   ---   --- 
|         | |   | |   | |   |
|         | |   | |   | |   |
|         | |   | |   | |   |
 ---         ---   ---       
|   |     | |   |     | |   |
|   |     | |   |     | |   |
|   |     | |   |     | |   |
 ---         ---   ---   --- 



Miguel A. Revilla
2000-02-09



ps. 숫자 값은 정수형으로 입력받기 때문에, int 형의 표현 범위를 벗어나면 오버플로우가 발생하여

     입력한 숫자와 다른 숫자가 표시될 수 있습니다. 예문과 실행파일과 똑같이 할 필요는 없다. 알

     고리즘의 이해가 중요하다.


기한 : 2009년 1월 29일 목요일 PM 11:50 까지.

제출 :
rockdrumy@nate.com or 네이트온.

제출방법 : 워드문서로 레포트 형식과 동일하게 소스와 실행화면 스샷과 함께 작성하고, 
               Word 파일과 c 파일 1개로 압축하여 제출. 


궁금한 점은 무조건 저한테만 문의 바람. 웹사이트 & 네이버 지식검색 참조 금물.


[참조] http://acm.uva.es/p/v7/706.html
Comments