Sherlock Holmes received a strange note: "Let's date!" 3485djdkxh4hhge 2984AKDFKKKKGGEDSB s&hgsfdk d&hyscvnm ". The big detective soon understood, the note on the strange garbled is actually the date of the time "Thursday 14:04", because the first two strings in the same uppercase English letter (case sensitivity) is the 4th letter ' D ', for Thursday, 2nd to the same character is ' E ', that is the 5th of the English alphabet, Represents the 14 head of the day (so that the day's 0 to 23 points are represented by the numbers 0 through 9, and the uppercase A through n); the next two string 1th to the same English letter ' s ' appears in the 4th position (counting from 0), representing the first 4 minutes. Now given two pairs of strings, please help Sherlock Holmes decode the time to get the appointment.
Input format:
The input gives 4 non-empty, space-free, and 60-length strings in 4 rows.
Output format:
The time to output an appointment in a single row, in the form "Day hh:mm", where "days" is a 3-character abbreviation for 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. The topic input guarantees that each test has a unique solution.
Input Sample:
3485djdkxh4hhge 2984AKDFKKKKGGEDSB S&HGSFDK d&hyscvnm
Sample output:
THU 14:04
This problem must be affixed!!!! Unexpectedly the topic thorough understanding crooked!!! Think too much, think too much. Considering the innumerable situation, did not expect the topic to give is the request. The first one must be the same if the uppercase caption a-g, the number 1-7 is not the same password!!! Lowercase letter A-g same also not password!!! The second same also cannot be lowercase letters!!! The third same cannot be a number ... Drunk, this should be my topic since the most without words, the topic is not clear enough, I think blindly, the topic is not always said some superficial things. I didn't think it was a superficial thing. Cry..
#include <iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<cctype>#include<cstdlib>#include<cmath>#include<string>#include<map>#include<Set>#include<queue>#include<vector>#include<stack>#include<cctype>using namespacestd;typedef unsignedLong Longull;#defineINF 0XFFFFFFFstringWeekintN) { Switch(n) { Case 1: return "MON"; Case 2: return "TUE"; Case 3: return "WED"; Case 4: return "THU"; Case 5: return "FRI"; Case 6: return "SAT"; Case 7: return "SUN"; }}intMain () {intx,y,i,j,k; Chara[Ten]; K=0; stringS1,s2,s3,s4; CIN>>s1>>s2>>s3>>S4; X=min (s1.size (), s2.size ()); for(i=0; i<x;++i)if(k==0&&s1[i]==s2[i]&& (s1[i]>='A'&&s1[i]<='G') ) {a[k++]=S1[i]; } Else if(k!=0&&s1[i]==s2[i]&& (s1[i]>='A'&&s1[i]<='N'|| s1[i]>='0'&&s1[i]<='9') ) {a[k++]=S1[i]; } x=min (s3.size (), s4.size ()); for(i=0; i<x;++i)if(s3[i]==s4[i]&&Isalpha (S3[i]) K=i; Y=a[0]-'A'+1; if(Isalpha (a[1])) {J=a[1]-'A'+Ten; }Else{J=a[1]-'0'; } cout<<week (y) <<" "; printf ("%02d:%02d\n", j,k); return 0;}
pat1014--Sherlock Holmes's date