YTU 1075: Time
1075: Time
时间限制: 1 Sec 内存限制: 128 MB
提交: 7 解决: 7
[提交][状态][讨论版]
题目描述
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>
int a[5];
int main()
{
while(scanf("%d%d%d%d",&a[0],&a[1],&a[2],&a[3])!=EOF)
{
for(int i=0; i<3; i++)
{
for(int j=0; j<=3; j++)
{
if(i==0)
{
if(a[j]==1)
printf(" ");
else if(a[j]==2)
printf(" _ ");
else if(a[j]==3)
printf(" _ ");
else if(a[j]==4)
printf(" ");
else if(a[j]==5)
printf(" _ ");
else if(a[j]==6)
printf(" _ ");
else if(a[j]==7)
printf(" _ ");
else if(a[j]==8)
printf(" _ ");
else if(a[j]==9)
printf(" _ ");
else if(a[j]==0)
printf(" _ "); }
else if(i==1)
{
if(a[j]==1)
printf(" |");
else if(a[j]==2)
printf(" _|");
else if(a[j]==3)
printf(" _|");
else if(a[j]==4)
printf("|_|");
else if(a[j]==5)
printf("|_ ");
else if(a[j]==6)
printf("|_ ");
else if(a[j]==7)
printf(" |");
else if(a[j]==8)
printf("|_|");
else if(a[j]==9)
printf("|_|");
else if(a[j]==0)
printf("| |");
}
else if(i==2)
{
if(a[j]==1)
printf(" |");
else if(a[j]==2)
printf("|_ ");
else if(a[j]==3)
printf(" _|");
else if(a[j]==4)
printf(" |");
else if(a[j]==5)
printf(" _|");
else if(a[j]==6)
printf("|_|");
else if(a[j]==7)
printf(" |");
else if(a[j]==8)
printf("|_|");
else if(a[j]==9)
printf(" _|");
else if(a[j]==0)
printf("|_|");
}
} printf("\n");
}
}
return 0;
}
YTU 1075: Time的更多相关文章
- ytu 1057: 输入两个整数,求他们相除的余数(带参的宏 + 模板函数 练习)
1057: 输入两个整数,求他们相除的余数 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 177 Solved: 136[Submit][Status ...
- ytu 1058: 三角形面积(带参的宏 练习)
1058: 三角形面积 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 190 Solved: 128[Submit][Status][Web Boar ...
- ural 1075. Thread in a Space
1075. Thread in a Space Time limit: 1.0 secondMemory limit: 64 MB There are three points in a 3-dime ...
- HDOJ 1075
字典树 9890974 2013-12-25 15:31:06 Accepted 1075 468MS 59832K 1342 B G++ 泽泽 #include<stdio.h> #in ...
- ytu 1980:小鼠迷宫问题(DFS 深度优先搜索)
小鼠迷宫问题 Time Limit: 2 Sec Memory Limit: 64 MB Submit: 1 Solved: 1 [Submit][Status][Web Board] Desc ...
- HDU 1075 What Are You Talking About(Trie的应用)
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/204800 K ...
- hdu 1075 (map)
http://acm.hdu.edu.cn/showproblem.php?pid=1075 What Are You Talking About Time Limit: 10000/5000 MS ...
- wikioi 1075 明明的随机数
/*============================================================ 1075 明明的随机数 题目描述 Description 明明想在学校中请 ...
- hdu 1075 What Are You Talking About
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075 题意:比较简单,易懂,这里不做说明. 解法:第一种方法:用map映射,耗时1000+ms:第二种 ...
随机推荐
- 如何使用jmeter进行并发登录测试
第一种方案直接从数据库中获取账号和密码 1.设置线程数为20 ,我们的并发用户量就是20个用户同时登录 2.添加定时器 3.设置集合点,当用户数量达到20个的时候再同时请求进行登录操作 4.添加配置元 ...
- POJ-3100-Root of the Problem,原来是水题,暴力求解~~~
Root of the Problem Time Limit: 1000MS Memory Limit: 65536K http://poj.org/problem?i ...
- 【二分+尺取】HDU 6119 小小粉丝度度熊
http://acm.hdu.edu.cn/showproblem.php?pid=6119 [思路] 首先通过处理交叉的可以处理成不交叉的 然后二分查找答案 如何判断一个长度是否可行? 双指针O(n ...
- hdu 1563简单异或Find your present!
#include<stdio.h> int main(){ int n,m,s; while(scanf("%d",&n),n) { s=0; w ...
- redis哨兵模式配置
java对redis的读写 依赖包:jedis.jar maven下: <!-- https://mvnrepository.com/artifact/redis.clients/jedis - ...
- msp430入门编程41
msp430中C语言的软件工程--状态机建模
- HDU 6396 贪心+优先队列+读入挂
Swordsman Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
- 学习日常笔记<day12>jsp基础
1.Jsp基础 1.1Jsp引入 Servlet的作用:用java语言开发动态资源的技术 Jsp的作用:用java语言(+html语言)开发动态资源的技术 jsp就是servlet 1.2Jsp的特点 ...
- SpringMVC get请求中文乱码
针对GET请求的编码问题,则需要改tomcat的server.xml配置文件,如下: 原 <Connector connectionTimeout="20000" port= ...
- zoom to raster resolution
don't execute the ESRI's command, just find out and write codes to zoom to the raster resolution. H ...