Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Book
- hadoop
- Book review
- history
- Programming
- Spain
- web
- Python
- program
- management
- leadership
- django
- hbase
- erlang
- MySQL
- ubuntu
- QT
- Kuala Lumpur
- RFID
- psychology
- Italy
- Linux
- essay
- comic agile
- Software Engineering
- programming_book
- Malaysia
- France
- Java
- agile
Archives
- Today
- Total
LC-Display 본문
A friend of yours has just bought a new computer. Before this, the most powerful machine he ever used was a pocket calculator. He is a little disappointed because he liked the LCD display of his calculator more than the screen on his new computer! To make him happy, write a program that prints numbers in LCD display style.
Input
The input file contains several lines, one for each number to be displayed. Each line contains integers s and n, where n is the number to be displayed ( 0$ \le$n$ \le$99, 999, 999) and s is the size in which it shall be displayed ( 1$ \le$s$ \le$10). The input will be terminated by a line containing two zeros, which should not be processed.
Output
Print the numbers specified in the input file in an LCD 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, including the last digit. There must be exactly one column of blanks between two digits.
Output a blank line after each number. You will find an example of each digit in the sample output below.
Sample Input
2 12345
3 67890
0 0
Sample Output
-- -- --
| | | | | |
| | | | | |
-- -- -- --
| | | | |
| | | | |
-- -- --
--- --- --- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- --- ---
Best: 0.008sec
-> 0.308sec
-> 0.312sec, code line 수 감소(139->78 line)
-> 0.308sec, 7 segment data를 기록하는 변수를 2차원 배열에서 1차원 배열로 수정
Input
The input file contains several lines, one for each number to be displayed. Each line contains integers s and n, where n is the number to be displayed ( 0$ \le$n$ \le$99, 999, 999) and s is the size in which it shall be displayed ( 1$ \le$s$ \le$10). The input will be terminated by a line containing two zeros, which should not be processed.
Output
Print the numbers specified in the input file in an LCD 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, including the last digit. There must be exactly one column of blanks between two digits.
Output a blank line after each number. You will find an example of each digit in the sample output below.
Sample Input
2 12345
3 67890
0 0
Sample Output
-- -- --
| | | | | |
| | | | | |
-- -- -- --
| | | | |
| | | | |
-- -- --
--- --- --- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- --- ---
Best: 0.008sec
-> 0.308sec
-> 0.312sec, code line 수 감소(139->78 line)
-> 0.308sec, 7 segment data를 기록하는 변수를 2차원 배열에서 1차원 배열로 수정
Comments