题目:Danny有一个时间段要陪妻子,还有一段时间有会议安排,求解是否可以参加会议。
分析:简单题。直接按字符串比较即可。
说明:(⊙v⊙)。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char time1_s[6], time1_e[6];
char time2_s[6], time2_e[6];
int main()
{
int n;
while (~scanf("%d",&n))
for (int t = 1; t <= n; ++ t) {
scanf("%s%s",time1_s,time1_e);
scanf("%s%s",time2_s,time2_e);
printf("Case %d: ",t);
if (strcmp(time2_e, time1_s) < 0 || strcmp(time1_e, time2_s) < 0) {
puts("Hits Meeting");
}else {
puts("Mrs Meeting");
}
}
return 0;
}