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. 【Oracle】【1】查询N分钟之前的数据

    --查询距离现在N分钟前的数据 1440:表示一天有1440分钟 SYSDATE - 10 :表示10天前 参考博客: 1,oracle 查询十分钟之前的数据 - 胡金水的博客 - CSDN博客 ht ...

  2. oracle 基本操作--事务

    事务:可以看做是由对数据可的若干操作组成的一个单元,浙西操作要么都完成,要么都取消,从而保证数据满足一致性的要求. 事务的组成: 一条或者多条DML 一条DDL 一条DCL DML语句需要使用comm ...

  3. Oracle11g温习-第十四章:约束( constraint )

    2013年4月27日 星期六 10:48 1.约束的功能 通过一些强制性商业规则,保证数据的完整性.一致性 2.约束的类别 1 )  not null    不允许为空     2 )  check  ...

  4. 平面最近点对模板[luogu P1429]

    %:pragma GCC optimize() #include<bits/stdc++.h> #define DB double #define m (((l)+(r))>> ...

  5. [CodeForces - 447E] E - DZY Loves Fibonacci Numbers

    E  DZY Loves Fibonacci Numbers In mathematical terms, the sequence Fn of Fibonacci numbers is define ...

  6. 自定义putty主题

    PuTTY很早之前就没有更新了(0.62),因为都是开源的所以有人branch出来做了增强,如这个PuTTY tray,增加了超链等功能: https://puttytray.goeswhere.co ...

  7. 【转】Vue-详解设置路由导航的两种方法: <router-link :to="..."> 和router.push(...)

    一.<router-link :to="..."> to里的值可以是一个字符串路径,或者一个描述地址的对象.例如: // 字符串 <router-link to= ...

  8. Angular4.x 引入第三方 JS

    引入 Jquery 使用 angular-cli 新建 angular项目 1.安装 jquery npm install jquery --save 2..angular-cli.json 中引入 ...

  9. Linux 下Qt实现守护进程实例(转)

     原文地址:Linux守护进程的编程方法(含实例) 作者:lingdxuyan 参考文献 Linux信号列表(zz) Linux 守护进程的编程方法 linux上编写守护进程的例程 Linux下后台守 ...

  10. 小程序BindTap快速连续点击页面跳转多次

    原因: 手机端点击Tap基础事件解决300ms延迟 解决办法: success 里面加一个延迟300ms能解决 setTimeout goRob(e) { const that = this retu ...