```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(b>d) {c--; d+=60;}
cout<<c-a<<" "<<d-b;;
return 0;
}
```
by MegaMay @ 2020-07-18 10:30:15
你的e的值写的不对
by MegaMay @ 2020-07-18 10:31:53
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,c;
int b,d;
int e,f;
cin>>a>>c>>b>>d;
if(d>c){
f=d-c;
e=b-a;
}else{
f=d-c+60;
e=b-a-1;
}
cout<<e<<" "<<f<<endl;
}
```
出来了,小时借一没按if算,
by Brian_Bit @ 2020-07-18 10:35:49
@[MegaMay](/user/162799) 对,e也按2种情况判断的,我就是少了一种
by Brian_Bit @ 2020-07-18 10:36:52
氵金可还行
by Ryo_Yamada @ 2020-07-18 10:50:55
我来发个AC代码吧
by Oliver0816 @ 2020-07-21 10:41:40
我发个AC码
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
c-=a;
d-=b;
if(d<0)
{
d+=60;
c--;
}
cout<<c<<" "<<d;
return 0;
}
```
by Im_iceman @ 2020-09-12 12:40:26
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{ int a,b,c,d,x,f;
cin>>a>>b>>c>>d;
x=c-a;
if (d<b)
{ x=x-1;
d=d+60;
f=d-b;
}
else if (d>b)
{ f=d-b;
}
cout<<x<<" "<<f;
return 0;
}
```
by 蛋蛋工作室 @ 2021-03-30 17:16:54
来,AC码
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e,f,g,x,y;
cin>>a>>b>>c>>d;
e=a*60+b;
f=c*60+d;
g=f-e;
x=g/60;
y=g-x*60;
printf("%d %d",x,y);
return 0;
}
```
by 我安静存在 @ 2021-05-04 21:02:53