题目
解题思路
模拟,【模拟的思路越简单明了越好(简单的题目!!!),否则就像我一样,Wonderful Answer(WA)】
代码
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int a,b,aa,bb,x,y;
int main()
{
freopen("sleep.in","r",stdin);
freopen("sleep.out","w",stdout);
scanf("%d:%d",&a,&b);
scanf("%d:%d",&aa,&bb);
a-=aa; b-=bb;
if (b<0) b+=60,a-=1; //特殊情况
if (a<0) a+=24;
if (a<=9) printf("0%d",a); else printf("%d",a);
printf(":");
if (b<=9) printf("0%d",b); else printf("%d",b);
}