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<math.h>
#include<string.h>
#include<stdlib.h>
int main(){
	int d,d1,d2,m,m1,m2,h,h1,h2;
	scanf("%d %d %d",&d1,&h1,&m1);
	scanf("%d %d %d",&d2,&h2,&m2);
	if(d2>=d1){
		if(d1>d2){
			d = d1-d2;
		}
		else{
			d = d2-d1;
		}
	}
	else{
		d = 7-d1+d2;
	}
	//printf("d:%d",d);
	if(d>1){
		printf("N o\n");
	}
	else{
		if(d==0){
			printf("Y e s\n");
		}
		else{
			if(d==1){
				h = h2+24-h1;
				if(h<24){
					printf("Y e s\n");
				}
				else if(h>24){
					printf("N o\n");
				}
				else{
					if(m2>m1){
						printf("N o\n");
					}
					else{
						printf("Y e s\n");
					}
				}
			}
		}
	}
}