1061 Dating
题目
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm
. It took him only a minute to figure out that those strange strings are actually referring to the coded time Thursday 14:04
-- since the first common capital English letter (case sensitive) shared by the first two strings is the 4th capital letter D
, representing the 4th day in a week; the second common character is the 5th capital letter E
, representing the 14th hour (hence the hours from 0 to 23 in a day are represented by the numbers from 0 to 9 and the capital letters from A
to N
, respectively); and the English letter shared by the last two strings is s
at the 4th position, representing the 4th minute. Now given two pairs of strings, you are supposed to help Sherlock decode the dating time.
Input Specification:
Each input file contains one test case. Each case gives 4 non-empty strings of no more than 60 characters without white space in 4 lines.
Output Specification:
For each test case, print the decoded time in one line, in the format DAY HH:MM
, where DAY
is a 3-character abbreviation for the days in a week -- that is, MON
for Monday, TUE
for Tuesday, WED
for Wednesday, THU
for Thursday, FRI
for Friday, SAT
for Saturday, and SUN
for Sunday. It is guaranteed that the result is unique for each case.
Sample Input:
1 | 3485djDkxh4hhGE |
Sample Output:
1 | THU 14:04 |
题意
有人给了福尔摩斯一张小纸条,要跟他约会,但是约会时间已经被加密了,现在要通过以下规则解密:
- 输入的4个字符串分为两组,第一组用来得出日期和小时,第二组得出分钟.
- 第一组中第一对位置相同的同一大写字母(A到G)代表了日期,A表示MON,G表示SUN.
- 第一组中第二对位置相同的同一数字或者大写字母(A到N)代表了小时,0表示0点,A表示10点,N表示23点.
- 第二组中第一对位置相同的同一大写或小写字母的位置代表分钟,下标0即第0分钟,下标4则第4分钟.
思路
又是一道因为题目规则没看明白浪费了一个上午的题,原来连题目都没看懂,真的烦,明白了规则其实这道题就比较简单了,就是相对位置一路比较过去就行了,但是一定要注意每个题目限定要求.
代码
1 | public static void Main() |