src2020/time/time.cpp

24 lines
448 B
C++
Raw Normal View History

2020-03-27 17:41:49 +08:00
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("order.in");
ofstream fout("order.out");
int main() {
long long anss,ansf;
int s,f;
fin>>anss>>ansf;
while (fin>>s>>f)
{
ansf-=f;
if(ansf<0){
anss--;
ansf+=60;
}
if(ansf>59){
anss++;
ansf-=60;
}
anss-=s;
}
fout<<anss<<":"<<ansf;
}