Advertisement
rahat62

Helping the HR

Sep 11th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.24 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     char a,b,c,d,e,f,s;
  7.     int t,h1,m1,h2,m2,s1,s2,cnt=0,time1,time2,time_diff;
  8.  
  9.  
  10.  
  11.     while (scanf("%d", &t) ==1)
  12.     {
  13.         if(t==0)
  14.             break;
  15.  
  16.         for(int i=0; i<t; i++)
  17.         {
  18.             cin>>s>>a>>h1>>b>>m1>>c>>s1>>d>>h2>>e>>m2>>f>>s2;
  19.  
  20.             if(s=='D')
  21.             {
  22.                 if(((h1*3600)+(m1*60)+s1)>34200)
  23.                     cnt++;
  24.  
  25.  
  26.                 if(((h1*3600)+(m1*60)+s1)<=34200 && ((h1*3600)+(m1*60)+s1)>=30600)
  27.                 {
  28.                     time1 = ((h1*3600)+(m1*60)+s1);
  29.                     time2 = ((h2*3600)+(m2*60)+s2);
  30.  
  31.                     time_diff = (time2-time1)/3600;
  32.  
  33.  
  34.                     if(time_diff<8)
  35.                         cnt++;
  36.                 }
  37.  
  38.  
  39.                 if(((h1*3600)+(m1*60)+s1)<30600)
  40.                 {
  41.                     time1 = 30600;
  42.                     time2 = ((h2*3600)+(m2*60)+s2);
  43.  
  44.                     time_diff = (time2-time1)/3600;
  45.  
  46.  
  47.                     if(time_diff<8)
  48.                         cnt++;
  49.  
  50.                 }
  51.  
  52.  
  53.  
  54.  
  55.  
  56.             }///For Day
  57.  
  58.  
  59.  
  60.             if(s=='E')
  61.             {
  62.                 if(((h1*3600)+(m1*60)+s1)>45000)
  63.                     cnt++;
  64.  
  65.  
  66.                 if(((h1*3600)+(m1*60)+s1)<=45000 && ((h1*3600)+(m1*60)+s1)>=30600)
  67.                 {
  68.                     time1 = ((h1*3600)+(m1*60)+s1);
  69.                     time2 = ((h2*3600)+(m2*60)+s2);
  70.  
  71.                     time_diff = (time2-time1)/3600;
  72.  
  73.  
  74.                     if(time_diff<9)
  75.                         cnt++;
  76.                 }
  77.  
  78.  
  79.                 if(((h1*3600)+(m1*60)+s1)<30600)
  80.                 {
  81.                     time1 = 30600;
  82.                     time2 = ((h2*3600)+(m2*60)+s2);
  83.  
  84.                     time_diff = (time2-time1)/3600;
  85.  
  86.  
  87.                     if(time_diff<9)
  88.                         cnt++;
  89.  
  90.                 }
  91.  
  92.  
  93.  
  94.  
  95.  
  96.             }///For eve
  97.  
  98.  
  99.  
  100.  
  101.  
  102.         }
  103.  
  104.         if(cnt ==0)
  105.             cout<<"All OK"<<endl;
  106.         if(cnt <=3 && cnt>0)
  107.             cout<<cnt<<" Point(s) Deducted"<<endl;
  108.         if(cnt >3)
  109.             cout<<"Issue Show Cause Letter"<<endl;
  110.  
  111.         cnt = 0;
  112.  
  113.  
  114.     }
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.     return 0;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement