Time To Get Up
来源:互联网 发布:炫佳网络 编辑:程序博客网 时间:2024/04/29 15:40
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 has5 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.
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 an7×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.
In each test case, there is an
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 stringt 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..XX..X....X.X....X.X..X......XX.....XX...XX.X..X.X....X....X.X..XX..X.X.........X.X..X.XX...XX.....XX...XX.
Sample Output
02:38
#include"iostream"using namespace std;char ai[100][100];int panduan(int a,int b){if(ai[a][b+1]=='X'){if(ai[a+1][b]=='X'){if(ai[a+3][b+1]!='X') return 0;else if(ai[a+4][b]!='X'&&ai[a+1][b+3]!='X') return 5;else if(ai[a+4][b]!='X') return 9;else if(ai[a+1][b+3]!='X') return 6;else return 8;}else{if(ai[a+4][b]=='X') return 2;else if(ai[a+3][b+1]=='X') return 3;else return 7;}}else{if(ai[a+1][b]=='X'){return 4;}else return 1;}}int main(){int t;cin>>t;while(t--){for(int i=0;i<7;i++){cin>>ai[i];}cout<<panduan(0,0);cout<<panduan(0,5);cout<<":";cout<<panduan(0,12);cout<<panduan(0,17)<<endl;}return 0;}
阅读全文
0 0
- Time To Get Up
- Time To Get Up
- Time To Get Up
- Time To Get Up
- HDU6077-Time To Get Up
- Time To Get Up HDU
- HDU6077-Time To Get Up
- hdu6077 Time To Get Up
- 杭电 Time To Get Up
- hdu-暑假集训-Time To Get Up
- hdu 6077-Time To Get Up
- HDU 6077 Time To Get Up 模拟
- HDU 6077 Time To Get Up【】
- HDU 6077 Time To Get Up
- hdu 6077 Time To Get Up【暴力】
- hdu 6077 Time To Get Up
- HDU6077 Time To Get Up 暴力
- hdu--6077 Time To Get Up
- [ubuntu 12] vi vim 入门使用 2015年总结
- 数据搜集
- 表结构的设计要做到优化分离
- 构建计算图 API
- 中医自治辩证-糖类代谢均衡
- Time To Get Up
- Jenkins安装后,无法创建maven项目
- CUDA Samples: matrix multiplication(C = A * B)
- 使用OpenCV开发机器视觉项目
- 39个优秀的Swift UI开源库
- 113. Path Sum II
- 基础数论算法(1)整除与同余
- Intelli idea 激活 license server
- [ubuntu 12] 命令行w3m上网工具安装和使用 2015年总结