错误历程
循环条件好好写!与或的关系找好!括号括明白!
code
/*
3485djDkxh4hhGE
2984akDfkkkkggEdsb
s&hgsfdk
d&Hyscvnm
*/
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
char weekday[7][10]= {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
int main()
{
//freopen("p1.txt", "r", stdin);
string a, b, c, d;
cin >> a >> b >> c >> d;
int k = 0;
while(true)
{
if (a[k] == b[k] && (a[k] >= 'A' && a[k] <= 'G')) break;
k ++ ;
}
printf("%s", weekday[a[k] - 'A' ] );
k ++ ;
while(true)
{
if (a[k] == b[k] && (isdigit(a[k]) || (a[k] >= 'A' && a[k] <= 'N'))) break;
k ++ ;
}
printf(" %02d", isdigit(a[k]) ? a[k] - '0': a[k] - 'A' + 10);
int i = 0;
for (;; i ++ )
{
if (c[i] == d[i] && isalpha(c[i])) break;
}
printf(":%02d\n", i);
return 0;
}