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 ...
随机推荐
- 【MySQL】【2】数字排序问题
--我用的方案 SELECT * FROM TABLE_Q ORDER BY CAST(ID AS SIGNED) ASC 备注: 不做特殊处理的话,数字位数不一样时排序有问题,比如10会比2小. 其 ...
- java正则中的requireEnd和hitEnd
package test; import java.util.regex.Matcher; import java.util.regex.Pattern; public class main { // ...
- Git:创建与合并分支
1.1创建dev分支,使用命令符 git branch 分支名称. 1.2将HEAD指针切换到dev分支,使用命名符git checkout 分支名称. 注:创建并且转移可以合并为一个步骤,使用命令符 ...
- JavaScript基础(三)
十三.JS中的面向对象 创建对象的几种常用方式 1.使用Object或对象字面量创建对象 2.工厂模式创建对象 3.构造函数模式创建对象 4.原型模式创建对象 1.使用Object或对象字面量创建对象 ...
- python 解析与生成xml
xml.etree.ElementTree模块为xml文件的提取和建立提供了简单有效的API.下文中使用ET来代表xml.etree.ElementTree模块. XML是一种内在的分层的数据形式,展 ...
- noip2017奶酪
题目描述 现有一块大奶酪,它的高度为 h,它的长度和宽度我们可以认为是无限大的,奶酪 中间有许多 半径相同 的球形空洞.我们可以在这块奶酪中建立空间坐标系,在坐标系中, 奶酪的下表面为z=0,奶酪的上 ...
- ActiveMQ 处理不同类型的消息
ActiveMQ 中的消息都继承自 org.apache.activemq.command.BaseCommand 类. broker 处理消息的调用栈如下: TransportConnection ...
- sqlmap sql注入工具
下载地址: https://github.com/sqlmapproject/sqlmap 参数可以在sqlmap.conf里指定 url = http://localhost:55556/crm/u ...
- 逆袭之旅DAY30.XIA.集合
2018年7月26日 面试题:List和set的区别 ArrayList 遍历效率较高,但添加和删除较慢 遍历集合最高效的方法:迭代器 集合的遍历: 迭代器:Iterator 创建 为什么使用泛型: ...
- 解决eclipse/myeclipse导入项目时出现红色叹号的方法