1#include <iostream>2#include <string>3 4 using namespacestd;5 6 intMain ()7 {8 stringS1, S2, S3, S4;9CIN >> S1 >> S2 >> S3 >>S4;Ten stringday[7]{"MON","TUE","WED","THU","FRI","SAT","SUN"}; One A inti =0, cnt=0; - while(I < s1.size () && i <s2.size ()) - { the if(S1[i] = = S2[i] && (S1[i] >='A'&&s1[i] <='G') &&cnt = =0) - { -cout << Day[s1[i]-'A'] <<" "; -cnt++; + } - Else if(S1[i] = = S2[i] && cnt = =1) + { A if(S1[i] >='0'&&s1[i] <='9') at { -cout <<0<<S1[i]; -cnt++; - } - Else if(S1[i] >='A'&&s1[i] <='N') - { incout << S1[i]-'A'+Ten; -cnt++; to } + } - if(CNT = =2) the Break; *i++; $ }Panax Notoginsengi =0; - while(I < s3.size () && i <s4.size ()) the { + if(S3[i] = = s4[i]&& ((s3[i]>='a'&&s3[i]<='Z')|| (s3[i]>='A'&&s3[i]<='Z'))) A { the if(I <9) +cout <<": 0"<<i; - Else $cout <<":"<<i; $ Break; - } -i++; the } - Wuyi}
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 is actually referring to the coded time "Thursday 14:0 4 "--since the first common capital 中文版 (case sensitive) shared by the first and strings is the 4th capital Le Tter ' 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 + a D Ay is represented by the numbers from 0 to 9 and the capital letters from A to N, respectively); and the Chinese letter gkfx by the last of the strings is ' s ' at the 4th position, representing the 4th minute. Now given and pairs of strings, you is supposed to help Sherlock decode the dating time.
Input Specification:
Each input file contains the one test case. Each case gives 4 non-empty strings of no more than, characters without white space in 4 lines.
Output Specification:
For each test case, print the decoded time on one line, in the format ' Day hh:mm ', where ' Day ' is a 3-character abbreviati On for the days in a week--that's, ' 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, the result is a unique for each case.
Sample Input:
3485djdkxh4hhge 2984AKDFKKKKGGEDSB S&HGSFDK d&hyscvnm
Sample Output:
THU 14:04
PAT 1061. Dating (20)