Start: Jan, 08, 2019 19:01:00
2018年秋季学期程序设计基础(C语言)期末考试
End: Jan, 08, 2019 21:46:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 6ms
Memory: 1092kB
In contest: 1258

#include <stdio.h>
#include<string.h>
#include<math.h>
struct s{
	double d;
	double h;
	double m;
};
int main() {
	struct s a[2];
	int i;
	double n;
	for(i=0;i<2;++i)
		scanf("%lf%lf%lf",&a[i].d,&a[i].h,&a[i].m);
	if((a[0].d==7)&&a[1].d!=7)
		a[1].d+=7;
	if((a[1].d>a[0].d)&&(a[1].h<a[0].h)){
		a[1].h+=24;
		if(a[1].d-a[0].d==1)
		a[1].d=a[0].d;
	}
	if(((a[1].d>a[0].d)||(a[1].h>a[0].h))&&(a[1].m<a[0].m)){
		a[1].m+=59;
		if(a[1].h>a[0].h)
			a[1].h-=1;
}
	n=(a[1].d-a[0].d)*3600*24+(a[1].h-a[0].h)*3600+(a[1].m-a[0].m)*60;
	if(0<=n&&n<=3600*24)
		printf("Y e s");
	else
		printf("N o");
}