1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
#include <iostream> #include <cstdio> #include <queue> #include <sstream> #include <string> #include <cstring> #include <cmath> using namespace std; int main() { int t; int kase=1; int hr1,hr2,hr3,hr4; int t1,t2,t3,t4; int mn1,mn2,mn3,mn4; string str1,str2,str3,str4; scanf("%d",&t); while(t--) { cin>>str1>>str2; cin>>str3>>str4; hr1=hr2=hr3=hr4=0; mn1=mn2=mn3=mn4=0; hr1=str1[0]-'0';hr1*=10; hr1+=(str1[1]-'0'); hr2=str2[0]-'0';hr2*=10; hr2+=(str2[1]-'0'); hr3=str3[0]-'0';hr3*=10; hr3+=(str3[1]-'0'); hr4=str4[0]-'0';hr4*=10; hr4+=(str4[1]-'0'); mn1=str1[3]-'0';mn1*=10; mn1+=(str1[4]-'0'); mn2=str2[3]-'0';mn2*=10; mn2+=(str2[4]-'0'); mn3=str3[3]-'0';mn3*=10; mn3+=(str3[4]-'0'); mn4=str4[3]-'0';mn4*=10; mn4+=(str4[4]-'0'); t1 = hr1*60+mn1; t2 = hr2*60+mn2; t3 = hr3*60+mn3; t4 = hr4*60+mn4; /* if(hr3>=hr1 && hr3<=hr2) { printf("Case %d: Mrs Meeting\n",kase++); } else if(hr3==hr2) { if(mn3<=mn2) printf("Case %d: Mrs Meeting\n",kase++); else printf("Case %d: Hits Meeting\n",kase++); } else if(hr4==hr1) { if(mn1<=mn4) printf("Case %d: Mrs Meeting\n",kase++); else printf("Case %d: Hits Meeting\n",kase++); } else printf("Case %d: Hits Meeting\n",kase++); */ if(t1>=t3 && t1<=t4) printf("Case %d: Mrs Meeting\n",kase++); else if(t3>=t1 && t3<=t2) printf("Case %d: Mrs Meeting\n",kase++); else printf("Case %d: Hits Meeting\n",kase++); } return 0; } |