Electronic clock, Electronic Table
1027: electronic clock score: 10 time limit: 1 second memory limit: 32 MB Special Judgment: No submitted: 17 solution: 11 tags
Description
An electronic clock uses four numbers to represent time. Each number is 3*3 in size. The characters used to represent numbers include '|', '_', and spaces.
Now, let us know how the clock shows the current time.
The digital style displayed by the clock is as follows:
_ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_|
Input Format
The input contains multiple groups of test data. Each input group contains four integers, indicating the current time.
Output
For each input group, the time style displayed by the electronic clock is output.
Sample Input
1 2 5 6
2 3 4 2
Sample output
___
| _
| _ |
___
_ |
| _
# Include <stdio. h> int main () {int n [4], I; while (scanf ("% d", & n [0], & n [1], & n [2], & n [3])! = EOF) {for (I = 0; I <4; I ++) {switch (n [I]) {case 1: case 4: // No output is allowed if no output is available. A space is required !!! Printf (""); break; default: printf ("_") ;}// the first row of printf ("\ n"); for (I = 0; I <4; I ++) {switch (n [I]) {case 1: case 7: printf ("|"); break; case 2: case 3: printf ("_ |"); break; case 4: case 8: case 9: printf ("| _ |"); break; case 5: case 6: printf ("| _"); break; case 0: printf ("|") ;}} printf ("\ n"); for (I = 0; I <4; I ++) {switch (n [I]) {case 1: case 4: case 7: printf ("|"); break; case 2: printf ("| _"); break; case 3: case 5: case 9: printf ("_ |"); break; case 6: case 8: case 0: printf ("| _ |"); break;} printf ("\ n ");}}