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:第二种 ...
随机推荐
- Laya 项目解耦
Manager解耦业务逻辑 Data解耦数据逻辑 View-UI解耦页面逻辑 ModuleController解耦通信逻辑
- Dream City(线性DP)
描述 JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the ya ...
- 【模板】prim的heap优化
简单的代码.. 时间复杂度为O((n + m)logn) 大部分情况下还是跑不过kruskal的,慎用. #include <cstdio> #include <queue> ...
- bzoj1086 [SCOI2005]王室联邦 树分块
[bzoj1086][SCOI2005]王室联邦 2014年11月14日2,6590 Description “余”人国的国王想重新编制他的国家.他想把他的国家划分成若干个省,每个省都由他们王室联邦的 ...
- 最大和(codevs 1648)
题目描述 Description N个数围成一圈,要求从中选择若干个连续的数(注意每个数最多只能选一次)加起来,问能形成的最大的和. 输入描述 Input Description 第一行输入N,表示数 ...
- 2016 Multi-University Training Contest 2 solutions BY zimpha
Acperience 展开式子, \(\left\| W-\alpha B \right\|^2=\displaystyle\alpha^2\sum_{i=1}^{n}b_i^2-2\alpha\su ...
- BZOJ2196: [Usaco2011 Mar]Brownie Slicing
n<=500 * m<=500的方阵,先沿横坐标切A-1刀,再把每一块切B-1刀,得到A*B块,求这A*B块的数字之和的最小值的最大值. 最小值最大--二分,然后贪心切.每次扫一行,看这一 ...
- Linux下出现launch failed.Binary not found的解决方案
Linux下出现launch failed.Binary not found的解决方案: Project->Properties->C/C++Build->Settings-> ...
- Minimum Spanning Tree.prim/kruskal(并查集)
开始了最小生成树,以简单应用为例hoj1323,1232(求连通分支数,直接并查集即可) prim(n*n) 一般用于稠密图,而Kruskal(m*log(m))用于系稀疏图 #include< ...
- webstorm js版本设置被重置
在下列路径下搜索ECMAScript,将版本号全部改为6 C:\Users\admin\.WebStorm2016.1\config\options\statistics.application.us ...