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:第二种 ...
随机推荐
- java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
今天这个问题排查了好大一会,开始网上有人这么说: https://www.cnblogs.com/rookiebob/p/3749396.html 但是仍未能解决我的问题, 最后发现是只在外层的pom ...
- Python内置函数—bytearray
英文文档: class bytearray([source[, encoding[, errors]]]) Return a new array of bytes. The bytearray cla ...
- NYOJ-116士兵杀敌(二),树状数组~~
士兵杀敌(二) 时间限制:1000 ms | 内存限制:65535 KB 难度:5 描述 南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的. 小工是南将军手下的军师,南将军经常想知 ...
- websocket个人理解总结
WebSocket 释义:聊天室.服务.套接字.协议 引用:https://www.ibm.com/developerworks/cn/web/1112_huangxa_websocket/index ...
- msp430入门编程42
msp430中C语言的软件工程--事件触发程序结构
- js面试题总结
1.typeof和Object.prototype.toString typeof是js里面判断变量类型的一种方法,但这种方法没有Object.prototype.toString准确,前者有6种判断 ...
- c++ 高性能日志库(muduo_AsyncLogging)
c++ 高性能日志库(muduo_AsyncLogging) 实现一个高效的网络日志库要解决那些问题? 首先明确一下问题的模型,这是一个典型的多生产者 单消费者问题,对于前端的日志库使用者来说,应该做 ...
- POJ 2484 A Funny Game【博弈】
相比数据结构的题..感觉这种想啊想的题可爱多了~~~代码量还少.... 题目链接: http://poj.org/problem?id=2484 题意: 一圈n个硬币,两人轮流从中取一或两个硬币,(只 ...
- [Bzoj2120]数颜色 (非正解 )(莫队)
2120: 数颜色 Time Limit: 6 Sec Memory Limit: 259 MBSubmit: 6286 Solved: 2489[Submit][Status][Discuss] ...
- Spring中基于AOP的XML架构
以下内容引用自http://wiki.jikexueyuan.com/project/spring/aop-with-spring-framenwork/xml-schema-based-aop-wi ...