问题 N: Time
时间限制: 1Sec 内存限制: 128MB
题目描述
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:
_ _ _ _ _ _ _ _
| _| _||_||_ |_ ||_||_|| |
||_ _| | _||_| ||_| _||_|
来源
辽宁省赛2010
代码:
#include<stdio.h> int main() { int a,b,c,d; char q[10][4]={" _ "," "," _ "," _ "," "," _ "," _ "," _ "," _ "," _ "}, w[10][4]={"| |"," |"," _|"," _|","|_|","|_ ","|_ "," |","|_|","|_|"}, e[10][4]={"|_|"," |","|_ "," _|"," |"," _|","|_|"," |","|_|"," _|"}; while(scanf("%d %d %d %d",&a,&b,&c,&d)!=EOF) { printf("%s%s%s%s\n",q[a],q[b],q[c],q[d]); printf("%s%s%s%s\n",w[a],w[b],w[c],w[d]); printf("%s%s%s%s\n",e[a],e[b],e[c],e[d]); } return 0; }