5 solutions
- 1
Information
- ID
- 19
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 5
- Tags
- # Submissions
- 26
- Accepted
- 14
- Uploaded By
#include <iostream>
using namespace std;
int main(){
int hour,min,end_hour,end_min;
cin>>hour>>min>>end_hour>>end_min;
int total=hour*60+min;
int end_total=end_hour*60+end_min;
int minutes=end_total-total;
cout<<minutes<<endl;
return 0;
}
#include using namespace std; int main() { int t,i,m,e; int x=0,y=0; cin>>t>>i>>m>>e; x=(m-t)*60; y=e-i; cout<<x+y;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,h,m,s=0;
cin>>a>>b>>c>>d;
if(d>=b)
{
h=c-a;
m=d-b;
}
else
{
h=c-a;
m=60-(b-d);
h--;
}
s+=h*60;
s+=m;
cout<<s;
}
C++ :
#include<bits/stdc++.h>
using namespace std;
int main(){
int sh,sm,eh,em;
cin>>sh>>sm>>eh>>em;
int t = 0;
t = (eh-sh)*60+em-sm;
cout<<t;
return 0;
}
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.