Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- char a,b,c,d,e,f,s;
- int t,h1,m1,h2,m2,s1,s2,cnt=0,time1,time2,time_diff;
- while (scanf("%d", &t) ==1)
- {
- if(t==0)
- break;
- for(int i=0; i<t; i++)
- {
- cin>>s>>a>>h1>>b>>m1>>c>>s1>>d>>h2>>e>>m2>>f>>s2;
- if(s=='D')
- {
- if(((h1*3600)+(m1*60)+s1)>34200)
- cnt++;
- if(((h1*3600)+(m1*60)+s1)<=34200 && ((h1*3600)+(m1*60)+s1)>=30600)
- {
- time1 = ((h1*3600)+(m1*60)+s1);
- time2 = ((h2*3600)+(m2*60)+s2);
- time_diff = (time2-time1)/3600;
- if(time_diff<8)
- cnt++;
- }
- if(((h1*3600)+(m1*60)+s1)<30600)
- {
- time1 = 30600;
- time2 = ((h2*3600)+(m2*60)+s2);
- time_diff = (time2-time1)/3600;
- if(time_diff<8)
- cnt++;
- }
- }///For Day
- if(s=='E')
- {
- if(((h1*3600)+(m1*60)+s1)>45000)
- cnt++;
- if(((h1*3600)+(m1*60)+s1)<=45000 && ((h1*3600)+(m1*60)+s1)>=30600)
- {
- time1 = ((h1*3600)+(m1*60)+s1);
- time2 = ((h2*3600)+(m2*60)+s2);
- time_diff = (time2-time1)/3600;
- if(time_diff<9)
- cnt++;
- }
- if(((h1*3600)+(m1*60)+s1)<30600)
- {
- time1 = 30600;
- time2 = ((h2*3600)+(m2*60)+s2);
- time_diff = (time2-time1)/3600;
- if(time_diff<9)
- cnt++;
- }
- }///For eve
- }
- if(cnt ==0)
- cout<<"All OK"<<endl;
- if(cnt <=3 && cnt>0)
- cout<<cnt<<" Point(s) Deducted"<<endl;
- if(cnt >3)
- cout<<"Issue Show Cause Letter"<<endl;
- cnt = 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement