1061 Dating (20 分)

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

分析: 卡了好久,因为case sensitive,这个意思是区分大小写。。另外capital letter是大写字母的意思
 /**
 * Copyright(c)
 * All rights reserved.
 * Author : Mered1th
 * Date : 2019-02-24-15.27.28
 * Description : A1061
 */
 #include<cstdio>
 #include<cstring>
 #include<iostream>
 #include<cmath>
 #include<algorithm>
 #include<string>
 #include<unordered_set>
 #include<map>
 #include<vector>
 #include<set>
 using namespace std;
 map<char,int> hashtable;
 ]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
 int main(){
 #ifdef ONLINE_JUDGE
 #else
     freopen("1.txt", "r", stdin);
 #endif
     string s1,s2,s3,s4;
     cin>>s1>>s2>>s3>>s4;
     int len1=s1.size(),len2=s2.size(),len3=s3.size(),len4=s4.size();
     int i;
     ;i<len1&&i<len2;i++){
         if(s1[i]==s2[i] && s1[i]>='A' &&s1[i]<='G'){
             cout<<we[s1[i]-'A']<<" ";
             i++;
             break;
         }
     }
     for(i;i<len1&&i<len2;i++){
         if(s1[i]==s2[i]){
             '){
                 printf(');
                 break;
             }
             else if(s1[i]>='A'&&s1[i]<='N'){
                 printf();
                 break;
             }
         }
     }
     ;i<len3&&i<len4;i++){
         if(s3[i]==s4[i]&&isalpha(s3[i])){
             printf("%02d",i);
             break;
         }
     }
     ;
 }

1061 Dating (20 分)的更多相关文章

  1. PAT 甲级 1061 Dating (20 分)(位置也要相同,题目看不懂)

    1061 Dating (20 分)   Sherlock Holmes received a note with some strange strings: Let's date! 3485djDk ...

  2. PAT Basic 1014 福尔摩斯的约会 (20 分) Advanced 1061 Dating (20 分)

    大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm.大侦探很快就明白了,字条上奇 ...

  3. 【PAT甲级】1061 Dating (20 分)

    题意: 给出四组字符串,前两串中第一个位置相同且大小相等的大写字母(A~G)代表了周几,前两串中第二个位置相同且大小相等的大写字母或者数字(0~9,A~N)代表了几点,后两串中第一个位置相同且大小相等 ...

  4. PAT甲级——1061 Dating (20分)

    Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkg ...

  5. 1061 Dating (20分)

    Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkg ...

  6. 1061. Dating (20)

    #include <stdio.h> #include <map> #include <string.h> #include <ctype.h> usi ...

  7. PAT (Advanced Level) 1061. Dating (20)

    简单模拟. #include<stdio.h> #include<string.h> ],s2[],s3[],s4[]; ][]={"MON ", &quo ...

  8. PAT甲题题解-1061. Dating (20)-字符串处理,水水

    #include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...

  9. pat1061. Dating (20)

    1061. Dating (20) 时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Sherlock Holmes ...

随机推荐

  1. MyEclipse WebSphere开发教程:WebSphere 7安装指南(三)

    [周年庆]MyEclipse个人授权 折扣低至冰点!立即开抢>> [MyEclipse最新版下载] 五.应用WebSphere 7.0.0.x和Java SDK更新 1. 要应用这些PAK ...

  2. zabbix监控系统的应用---数据监控、导入模板、告警

    一.zabbix监控nginx服务 1)在server2中安装nginx服务 --->  rpm  -ivh  nginx-1.8.0-1.el6.ngx.x86_64.rpm 2)编辑配置文件 ...

  3. GitLab项目迁移到Gerrit

    1.在Gerrit上新建项目: 2.Gerrit项目配置权限(此处非代码): Reference:refs/* Push Annotated Tag Push Signed Tag Forge Com ...

  4. Objective-C和Swift混合编程开发

    创建混编的Framework工程 第一步:创建target为Framework的工程 打开Xcode6-Beta,菜单栏File—>New—>Project; 创建一个新的工程,工程模板选 ...

  5. https页面证书验证、加密过程简介

    1.服务器向CA机构获取证书(假设这个证书伪造不了),当浏览器首次请求服务器的时候,服务器返回证书给浏览器.(证书包含:公钥+申请者与颁发者的相关信息+签名) 2.浏览器得到证书后,开始验证证书的相关 ...

  6. Windows Phone 8, 添加Map控件

    摘要: 1. 添加Map控件到程序. 2. 在Map控件中显示您当前的位置. 内容: 首先在WMAppManifest.xml中的Capabilities选项卡中勾选如下两项:ID_CAP_MAP, ...

  7. CentOS7安装OpenStack(Rocky版)-09.安装Cinder存储服务组件(控制节点)

    本文分享openstack的Cinder存储服务组件,cinder服务可以提供云磁盘(卷),类似阿里云云盘 ----------------------- 完美的分隔线  -------------- ...

  8. U-Boot_bmp_logo_hacking

    /*********************************************************************** * U-Boot_bmp_logo_hacking * ...

  9. linux-推荐两款好用的录屏软件

    前言 测试程序过程中需要看运行效果如何,可以使用录屏软件进行回放. 软件安装 添加源:sudo add-apt-repository ppa:maarten-baert/simplescreenrec ...

  10. ZOJ2067 经典 DP(单调队列优化)

    题目:一个由‘.’和‘#’组成矩形,统计里面'.'组成的矩形的个数. 点击打开链接 自己写挂了,懒得搞了 #include <stdio.h> #include <string.h& ...