Problem Description
Little Q's clock is alarming! It's time to get up now! However, after reading the time on the clock, Little Q lies down and starts sleeping again. Well, he has 5 alarms, and it's just the first one, he can continue sleeping for a while.

Little Q's clock uses a standard 7-segment LCD display for all digits, plus two small segments for the '':'', and shows all times in a 24-hour format. The '':'' segments are on at all times.

Your job is to help Little Q read the time shown on his clock.

 
Input
The first line of the input contains an integer T(1≤T≤1440), denoting the number of test cases.

In each test case, there is an 7×21 ASCII image of the clock screen.

All digit segments are represented by two characters, and each colon segment is represented by one character. The character ''X'' indicates a segment that is on while ''.'' indicates anything else. See the sample input for details.

 
Output
For each test case, print a single line containing a string t in the format of HH:MM, where t(00:00≤t≤23:59), denoting the time shown on the clock.
 
Sample Input
1
.XX...XX.....XX...XX.
X..X....X......X.X..X
X..X....X.X....X.X..X
......XX.....XX...XX.
X..X.X....X....X.X..X
X..X.X.........X.X..X
.XX...XX.....XX...XX.
 
Sample Output
02:38

题意:把字符串翻译成时间。

题解:直接利用他们的区别判断即可。

 #include <iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<cmath>
#include<cstring>
using namespace std; char time[+][+];
int check(int i)
{
int j;
if(time[][i]=='X')
{
if(time[][i+]=='.')
return ;
else if(time[][i]=='.')
return ;
else if(time[][i+]=='.')
return ;
else
return ;
}
else
{
if(time[][i]=='X')
{
if(time[][i+]=='X')
{
if(time[][i+]=='X')
return ;
else
return ;
}
else
return ;
}
else
{
if(time[][i+]=='.')
{
if(time[][i+]=='X')
return ;
else
return ;
}
else
return ;
}
}
} int main()
{
int a,b,c,d;
int T;
scanf("%d",&T);
while(T--)
{
for(int i=;i<=;i++)
for(int j=;j<=;j++)
cin>>time[i][j];
a=check();
b=check();
c=check();
d=check();
printf("%d%d:%d%d\n",a,b,c,d);
}
return ;
}

HDU 6077 17多校4 Time To Get Up 水题的更多相关文章

  1. HDU 6124 17多校7 Euler theorem(简单思维题)

    Problem Description HazelFan is given two positive integers a,b, and he wants to calculate amodb. Bu ...

  2. HDU 6106 17多校6 Classes(容斥简单题)

    Problem Description The school set up three elective courses, assuming that these courses are A, B, ...

  3. HDU 6049 17多校2 Sdjpx Is Happy(思维题difficult)

    Problem Description Sdjpx is a powful man,he controls a big country.There are n soldiers numbered 1~ ...

  4. HDU 6140 17多校8 Hybrid Crystals(思维题)

    题目传送: Hybrid Crystals Problem Description > Kyber crystals, also called the living crystal or sim ...

  5. HDU 6143 17多校8 Killer Names(组合数学)

    题目传送:Killer Names Problem Description > Galen Marek, codenamed Starkiller, was a male Human appre ...

  6. HDU 6045 17多校2 Is Derek lying?

    题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6045 Time Limit: 3000/1000 MS (Java/Others)    Memory ...

  7. HDU 3130 17多校7 Kolakoski(思维简单)

    Problem Description This is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This seq ...

  8. HDU 6038 17多校1 Function(找循环节/环)

    Problem Description You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1. D ...

  9. HDU 6034 17多校1 Balala Power!(思维 排序)

    Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He want ...

随机推荐

  1. bzoj-2038-莫队

    2038: [2009国家集训队]小Z的袜子(hose) Time Limit: 20 Sec  Memory Limit: 259 MBSubmit: 15784  Solved: 7164[Sub ...

  2. Oracle11g温习-第十六章:用户管理

    2013年4月27日 星期六 10:50 1.概念 (1)schema : user.object    就是用户创建的对象 (2)用户认证方式:                            ...

  3. Ajax实现跨域访问的两种方法

    调程序时遇到"已拦截跨源请求:同源策略禁止读取位于--的远程资源",这是因为通过ajax调用其他域的接口会有跨域问题. 解决方法如下: 方法一:服务器端(PHP)设置header头 ...

  4. [洛谷 P3788] 幽幽子吃西瓜

    妖梦费了好大的劲为幽幽子准备了一个大西瓜,甚至和兔子铃仙打了一架.现在妖梦闲来无事,就蹲在一旁看幽幽子吃西瓜.西瓜可以看作一个标准的球体,瓜皮是绿色的,瓜瓤是红色的,瓜皮的厚度可视为0.妖梦恰好以正视 ...

  5. ES6 开发常用新特性以及简述ES7

    一.关于变量 ES6新增:块级作用域变量 1.let定义块级作用域变量 没有变量的提升,必须先声明后使用 let声明的变量,不能与前面的let,var,conset声明的变量重名 { { consol ...

  6. iOS block 机制

    本文要将block的以下机制,并配合具体代码详细描述: block 与 外部变量 block 的存储域:栈块.堆块.全局块 定义 块与函数类似,只不过是直接定义在另一个函数里,和定义它的那个函数共享同 ...

  7. Oracle12c版本中未归档隐藏参数

    In this post, I will give a list of all undocumented parameters in Oracle 12.1.0.1c. Here is a query ...

  8. ActiveMQ producer 提交事务时突然宕机,会发生什么

    producer 在提交事务时,发生宕机,commit 的命令没有发送到 broker,这时会发生什么? ActiveMQ 开启事务发送消息的步骤: session.getTransactionCon ...

  9. was修改控制台端口教程

    这里我控制台启用了https所以修改WC_adminhost_secure,如果要修改控制台http的端口那么修改WC_adminhost (要修改应用的访问端口,则http--修改WC_defaul ...

  10. OpenSSH隐藏版本号教程

    1.查看当前OpenSSH版本号 sshd -v #sshd并没有-v选项,这并不是重点重点是这样能曝出版本号 2.查看sshd位置 which sshd 3.备份sshd cp /usr/sbin/ ...