Advertisement
Debashish_Saha

Uva 12136 Schedule of a Married Man

Feb 9th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6.     int tc,t=0,h1,h2,h3,h4,m1,m2,m3,m4,no=0;
  7.  
  8.     scanf("%d",&tc);
  9.     while(tc--) {
  10.         int a=0,b=0,c=0,d=0;
  11.         scanf("%d%:%d%d:%d",&h1,&m1,&h2,&m2);
  12.         scanf("%d:%d%d:%d",&h3,&m3,&h4,&m4);
  13.         a=(h1*60)+m1;
  14.         b=(h2*60)+m2;
  15.         c=(h3*60)+m3;
  16.         d=(h4*60)+m4;
  17.         if(h1<a&&d<a) {
  18.             if(c<b)
  19.                 printf("Case %d: Hits Meeting\n",++no);
  20.             else
  21.                 printf("Case %d: Mrs Meeting\n",++no);
  22.         } else if(c>a&&d>a) {
  23.             if(c>b)
  24.                 printf("Case %d: Hits Meeting\n",++no);
  25.             else
  26.                 printf("Case %d: Mrs Meeting\n",++no);
  27.         } else
  28.             printf("Case %d: Mrs Meeting\n",++no);
  29.  
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement