Home > Back-end >  PAT (Basic Level) Practice (in Chinese), 1014 Sherlock Holmes's date (20 points)
PAT (Basic Level) Practice (in Chinese), 1014 Sherlock Holmes's date (20 points)

Time:09-25

for help!
 
# include & lt; iostream>
#include
using namespace std;
Const int N=60;
Int main ()
{
Char a [N]={0}, b={0} [N], c={0} [N], [N] d={0};
The scanf (" % s % s % s % s ", a, b, c, d);
Int state=0, day, hour, minute, len.
If (strlen (a) & gt; The strlen (b))
Len=strlen (b);
The else len=strlen (a);
for(int i=0; iIf (state==0) {
If ([I] a [I]==b) {
If (a [I] & gt;='A' & amp; & A [I] <='G') {
Day=a [I] - 'a';
State++;
}
}
}
Else if (state==1) {
If ([I] a [I]==b) {
If (a [I] & gt;='A' & amp; & A [I] <='N') {
Hour=a [I] - 'a' + 10;
State++;
}
Else if (isdigit (a) [I]) {
Hour=a, [I] - '0'.
State++;
}
}
}
Else if (state==2) break;
}
for(int i=0; iIf (c [I]==d [I]) {
If (isalpha (c) [I]) {
Minute=I;
break;
}
}
}
The switch (day)
{
Case 0:
Printf (" MON ");
break;
Case 1:
Printf (" TUE ");
break;
Case 2:
Printf (" WED ");
break;
Case 3:
Printf (" THU ");
break;
Case 4:
Printf (" FRI ");
break;
Case 5:
Printf (" SAT ");
break;
Case 6:
Printf (" SUN ");
}
02 02 printf (" % d: % d ", hour, minute);
return 0;
}

CodePudding user response:

Subject? There are links to the best

CodePudding user response:

Subject? There are links to the best
  • Related