方法1:(自写)(注意时间格式为 09:09)
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char day[7][5] ={"MON","TUE","WED","THU","FRI","SAT","SUN"};
string a1,a2,a3,a4;
int n1,n2,n3,n4,k1,k2;
getline(cin,a1);
getline(cin,a2);
getline(cin,a3);
getline(cin,a4);
n1=a1.length();
n2=a2.length();
n3=a3.length();
n4=a4.length();
n1>n2?k1=n1:k1=n2;
int kk1=k1,kk2;
//输出day
for(int i=0;i<k1;i++)
{
if(a1[i]==a2[i]&&a1[i]>='A'&&a1[i]<='G')
{
cout<<day[a1[i]-'A']<<" ";
kk1=i+1;