Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int fintimes()
- {
- int h1, h2, h3, m1, m2, m3, s1, s2, s3, T1,T2, T3, winH, winM, winS, winT, r, secT;
- r=scanf("%d:%d:%d", &h1, &m1, &s1);
- scanf("%d:%d:%d", &h2, &m2, &s2);
- scanf("%d:%d:%d", &h3, &m3, &s3);
- winT=h1*3600+m1*60+s1;
- secT=h2*3600+m2*60+s2;
- while(r==3)
- {
- printf("%d:%d:%d\n", h1, m1, s1); //print the winning time
- T1=h2*3600+m2*60+s2;
- T1=T1-winT;
- printf("+%d:%02d:%02d ", T1/3600, (T1%3600)/60, T1%60); //difference with respect to the previous time
- printf("%d:%02d:%02d\n", T1/3600, (T1%3600)/60, T1%60); //difference with respect to the winning time
- T2=h3*3600+m3*60+s3;
- T2=T2-secT;
- printf("+%d:%02d:%02d ", T2/3600, (T2%3600)/60, T2%60); //difference with respect to the previous time
- T3=h3*3600+m3*60+s3;
- T3=T3-winT;
- printf("%d:%02d:%02d", T3/3600, (T3%3600)/60, T3%60); //difference with respect to the winning time
- break;
- }
- }
- int main()
- {
- fintimes();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement