博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1061 Dating
阅读量:6946 次
发布时间:2019-06-27

本文共 2437 字,大约阅读时间需要 8 分钟。

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:

3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm

Sample Output:

THU 14:04
#include
#include
#include
#include
using namespace std;int main(){ string ch[7] = { "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" }; int i = 0; string s1, s2, s3, s4; cin >> s1 >> s2 >> s3 >> s4; int s1length = s1.length(), s2length = s2.length(), s3length = s3.length(), s4length = s4.length(); int a = min(s1length, s2length); int b = min(s3length, s4length); for ( i = 0; i
= 'A' && s1[i] <= 'G') { cout << ch[(s1[i] - 'A' )] << ' '; break; } /*else if (s1[i] >= 97 && s1[i] <= 122) { cout << ch[(s1[i] - 'a' )] << " "; break; }*/ } } for ( ++i; i
= 'A'&&s1[i] <= 'N') { printf("%02d:", (10 + s1[i] - 'A')); break; } } } for (i = 0; i

 

转载于:https://www.cnblogs.com/binanry/p/10016933.html

你可能感兴趣的文章
python 元祖(tuple)
查看>>
java.lang.Long cannot be cast to java.lang.Integer解决办法
查看>>
设置datagridview中button按钮的背景颜色
查看>>
十大Intellij IDEA快捷键(转)
查看>>
Mysql - 解决Access denied for user ''@'localhost' to database 'mysql'问题
查看>>
JavaScript、CSS、JSP 实现用户注册页面与信息校验
查看>>
深入理解定位父级offsetParent及偏移大小
查看>>
使用PowerShell收集多台服务器的性能计数器
查看>>
jquery 中一些 特殊方法 的特殊使用 一览表
查看>>
yuv rgb 像素格式1
查看>>
通过PHP扩展phpredis操作redis
查看>>
如何在Swift里用UnsafeMutablePointer
查看>>
UML类图和时序图
查看>>
内存拷贝
查看>>
c_str()
查看>>
install ubuntu tweak on ubuntu lts 10.04,this software is created by zhouding
查看>>
Objective-C中一种消息处理方法performSelector: withObject:
查看>>
JSP实现分页显示
查看>>
关注HTML5安全
查看>>
ios中Pldatabase的用法(4)
查看>>