<center style="color&#58;rgba&#40;0&#44;0&#44;0&#44;&#46;87&#41;&#59;font&#45;family&#58;Lato&#44; &#39;Helvetica Neue&#39;&#44; Arial&#44; Helvetica&#44; sans&#45;serif&#59;font&#45;size&#58;14px&#59;">

问题 : Time

时间限制: 1 Sec   内存限制: 128 MB
</center>

题目描述

Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed by the digital clock.

输入

There are several test cases.

Each case contains 4 integers in a line, separated by space.

Proceed to the end of file.

输出

For each test case, output the time expressed by the digital clock such as Sample Output.

样例输入

1 2 5 6
2 3 4 2

样例输出

    _  _  _ 
  | _||_ |_ 
  ||_  _||_|
 _  _     _ 
 _| _||_| _|
|_  _|  ||_ 

提示

The digits showed by the digital clock are as follows:
   _  _     _  _  _  _  _  _ 
 | _| _||_||_ |_   ||_||_|| |
 ||_  _|  | _||_|  ||_| _||_|

解题思路

水题,按照所给的数字输出对应数字时钟显示的数字就可以了。

#include <stdio.h>
#include <string.h>
char top1[10][4] = {" _ ", "   ", " _ ", " _ ", "   ", " _ ", " _ ", " _ ", " _ ", " _ "};
char top2[10][4] = {"| |", "  |", " _|", " _|", "|_|", "|_ ", "|_ ", "  |", "|_|", "|_|"};
char top3[10][4] = {"|_|", "  |", "|_ ", " _|", "  |", " _|", "|_|", "  |", "|_|", " _|"};
int main()
{
    int s, a[4];
    while (~scanf("%d%d%d%d", &a[0], &a[1], &a[2], &a[3]))
    {
        for (int i = 0; i < 4; i++)
            printf("%s", top1[a[i]]);
        printf("\n");
        for (int i = 0; i < 4; i++)
            printf("%s", top2[a[i]]);
        printf("\n");
        for (int i = 0; i < 4; i++)
            printf("%s", top3[a[i]]);
        printf("\n");
    }
    return 0;
}