HDU 6077 17多校4 Time To Get Up 水题
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.
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.
题意:把字符串翻译成时间。
题解:直接利用他们的区别判断即可。
#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 水题的更多相关文章
- HDU 6124 17多校7 Euler theorem(简单思维题)
Problem Description HazelFan is given two positive integers a,b, and he wants to calculate amodb. Bu ...
- HDU 6106 17多校6 Classes(容斥简单题)
Problem Description The school set up three elective courses, assuming that these courses are A, B, ...
- 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~ ...
- HDU 6140 17多校8 Hybrid Crystals(思维题)
题目传送: Hybrid Crystals Problem Description > Kyber crystals, also called the living crystal or sim ...
- HDU 6143 17多校8 Killer Names(组合数学)
题目传送:Killer Names Problem Description > Galen Marek, codenamed Starkiller, was a male Human appre ...
- HDU 6045 17多校2 Is Derek lying?
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6045 Time Limit: 3000/1000 MS (Java/Others) Memory ...
- 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 ...
- 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 ...
- HDU 6034 17多校1 Balala Power!(思维 排序)
Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He want ...
随机推荐
- nyoj-1250-exgcd
机器人 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 Dr. Kong 设计的机器人卡尔非常活泼,既能原地蹦,又能跳远.由于受软硬件设计所限,机器人卡尔只能定点跳远 ...
- sql语句的各种模糊查询语句
一般模糊语句如下: SELECT 字段 FROM 表 WHERE 某字段 Like 条件 其中关于条件,SQL提供了四种匹配模式: 1.%:表示任意0个或多个字符.可匹配任意类型和长度的字符,有些情况 ...
- java正则中的requireEnd和hitEnd
package test; import java.util.regex.Matcher; import java.util.regex.Pattern; public class main { // ...
- MySQL5.6复制技术(3)-MySQL主从复制线程状态转变
一.主库线程状态(State)值 以下列表显示了主从复制中主服务器的Binlog Dump线程的State列中可能看到的最常见状态(SHOW PROCESSLIST).如果Binlog Dump线程在 ...
- nginx是什么,如何使用
一:nginx是什么? 二:nginx作为网关,需要具备什么?(nginx可以作为web服务器,但更多的时候,我们把它作为网关,因为它具备网关必备的功能:) 反向代理(反向代理就是服务器找来一个机器代 ...
- 八、持久层框架(MyBatis)
一.基于MyBatis的CRUD 1.首先是配置文件Category.xml修改 一次性修改配置文件Category.xml,提供CRUD对应的sql语句. <?xml version=&quo ...
- FJUT16级第一周寒假作业题解I题
涨姿势题3 TimeLimit:1000ms MemoryLimit:128000KB 64-bit integer IO format:%lld Problem Description 涨姿势题就 ...
- PHP如何自定义PHP内置函数
其实对于PHP程序员,有个纯PHP的解决方案.在php.ini里有个配置项 auto_prepend_file,可以设置一个PHP文件作为每次执行前自动加载的文件. 在这个文件里写函数,你就可以当成定 ...
- kali菜单中各工具功能
一.说明 各工具kali官方简介(竖排):https://tools.kali.org/tools-listing 安装kali虚拟机可参考:https://www.cnblogs.com/lsdb/ ...
- 解决win10打开组策略弹出管理模板对话框问题
今天win10企业版更新完系统,打开组策略编辑器时弹出管理模板对话框问题 1.问题描述 打开组策略编辑器时弹出管理模板对话框问题 2.解决方法 1)window+x 打开命令提示符(管理员) 2)输入 ...