Time

简介: Time

问题 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;
}
目录
相关文章
|
关系型数据库 MySQL PostgreSQL
PSQLException: 错误: 函数 date_format(timestamp without time zone, unknown) 不存在
PSQLException: 错误: 函数 date_format(timestamp without time zone, unknown) 不存在
342 0
|
敏捷开发
Is It Time for Another IT Methodology Update?
Cloud computing starter packages can offer extraordinary value for money, but we need to Finance teams to work much more closely with IT teams.
2490 0
Is It Time for Another IT Methodology Update?
|
网络协议 测试技术
TIME_WAIT过多及解决
最近用http_load做压测,跑出来一大串“Cannot assign requested address ”的错误,查了一下,是TIME_WAIT过多导致的。因为短时间内有太多连接,所以占用了大量端口,同时关闭连接后又处于TIME_WAIT状态,端口不能复用,所以慢慢的无端口可用,所以就“Cannot assign requested address”了。
1123 1
|
Unix
TIME
1176 0
|
关系型数据库