Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by Andrej ( 6 years ago )
#include <stdio.h>
2
#include <math.h>
3
#include <stdlib.h>
4
int main(){
5
 
6
    int m1,s1,m2,s2,m3,s3,a;
7
    scanf("%d %d %d %d",&m1,&s1,&m2,&s2);
8
    
9
    if((m1>=0)&&(m1<=59)&&(s1>=0)&&(s1<=59)&&(m2>=0)&&(m2<=59)&&(s2>=0)&&(s2<=59))
10
    {
11
        printf("DA\n");
12
a=abs((m1*60+s1)-(m2*60+s2));
13
        m3=a/60;
14
        s3=a-m3*60;
15
        printf("%d %d",m3,s3);
16
    }
17
    else
18
        printf("NE");
19
        
20
       
21
    
22
    return 0;
23
        
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
}

 

Revise this Paste

Your Name: Code Language: