#14670: 求解


fionahung0908 (username)

學校 : 臺北市私立延平高級中學
編號 : 69055
來源 : [180.217.99.153]
最後登入時間 :
2020-10-19 15:02:55
d669. 11677 - Alarm Clock -- UVa11677 | From: [203.72.178.252] | 發表日期 : 2018-07-30 14:51

#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int a,b,c,d;
while(cin>>a>>b>>c>>d)
{
if(a==0&&b==0&&c==0&&d==0) break;
if(a<c||a==c&&b<d) cout<<(c-a)*60+d-b<<endl;
else if(a>c||a==c&&b>d) cout<<((c+24)*60+d)-(a*60+b)<<endl;
}
return 0;
}

 
ZeroJudge Forum