不说人话的题之一。
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string s1, s2, s3, s4;
cin>>s1>>s2>>s3>>s4;
vector<string> day{"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
int d = -1, h = -1, m = -1, i;
for (i = 0; i < s1.length(); i++)
{
if (s1[i] == s2[i] && s1[i] >= 'A' and s1[i] <= 'G')
{
d = s1[i] - 'A';
break;
}
}
for ( i++; i < s1.length() && i < s1.length(); i++)
if (s1[i] == s2[i])
{
if (s1[i] <= 'N' && s1[i] >= 'A')
h = s1[i]- 'A' + 10;
else if (s1[i] <= '9' && s1[i] >= '0')
h = s1[i]- '0';
if (h>0)
break;
}
for (m = 0; m < s3.length() && m < s4.length(); m++)
if (s3[m] == s4[m] && isalpha(s3[m]))
break;
cout << day[d] << " " << (h < 10 ? "0" : "") << h <<":"<< (m < 10 ? "0" : "") << m << endl;
}