B1061 Dating (模拟)

B1061 Dating (20分)

这题拿满分题目必须仔细 !而且是指定的字母范围。

//第一个相同的大写字母[A,G],接着之后有第二个相同的[0,9]或者[A,N]的字符

//有相同的英文字符返回位置(不区分大小写)

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
typedef long long ll;
const int MAX=100005;
const int INF=0x3f3f3f3f;
const int mod=1000000007;
char mpday[10][10]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
int main()
{
    int t1,t2=0,t3=0;
    string s1,s2,s3,s4;
    cin>>s1>>s2>>s3>>s4;
    int minlen=min(s1.size(),s2.size());
    for(int i=0;i='A'&&s1[i]<='G')
        {
            if(s1[i]==s2[i])
            {
                t1=i;
                break;
            }
        }
    }
    cout<='A'&&s1[i]<='N')||(s1[i]>='0'&&s1[i]<='9'))
        {
            if(s1[i]==s2[i])
            {
                t2=i;
                break;
            }
        }
    }
    if(s1[t2]>='A'&&s1[t2]<='Z')
        printf("%02d:",s1[t2]-'A'+10);
    else if(s1[t2]>='0'&&s1[t2]<='9')
        printf("%02d:",s1[t2]-'0');
    int minlen2=min(s3.size(),s4.size());
    for(int i=0;i='A'&&s3[i]<='Z')||(s3[i]>='a'&&s3[i]<='z'))
        {
            if(s3[i]==s4[i])
            {
                t3=i;
                break;
            }
        }
    }
    printf("%02d\n",t3);
    return 0;
}

你可能感兴趣的:(B1061 Dating (模拟))