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>
int main() {
	int r,a1,a2,a3,b1,b2,b3;
	int day,hour,time;
	scanf("%d %d %d",&a1,&a2,&a3);
	scanf("%d %d %d",&b1,&b2,&b3);
	day=b1-a1;
	hour=b2-a2;
	time=b3-a3;
	if(day==0)
	{
		r=1;
	}
	else if(day==1)
	{
		if(hour<0)
		{
			r=1;
		}
		else if(hour>0)
		{
			r=2;	
		} 
		else if(hour==0)
		{
			if(time>0)
			{
				r=2;
			}
			else if(time<=0)
			{
				r=1;
			}
		}
	}
	else if(day>=2)
	{
		r=2;
	}
	else if(day==-6)
	{
		if(hour<0)
		{
			r=1;
		}
		else if(hour>0)
		{
			r=2;	
		} 
		else if(hour==0)
		{
			if(time>0)
			{
				r=2;
			}
			else if(time<=0)
			{
				r=1;
			}
		}
	}
	else if(day>-6&&day<0)
	r=2;

	if(r==1)
	{
		printf("Y e s\n");
	}
	else if(r==2)
	{
		printf("N o\n");
	}
	return 0;
}