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 p[3];
	int q[3];
	int i;//4 0 0     5 0 1
	for (i=0;i<3;i++){
		scanf("%d",&p[i]);
	}
	getchar();
	for (i=0;i<3;i++){
		scanf("%d",&q[i]);
	}
	getchar();
	if(q[0]>=p[0]){
	if(q[0]-p[0]>=2){
		printf("N o\n");
	}
	else {
		if(q[0]==p[0])printf("Y e s\n");
		else if(q[0]!=p[0]){
			if(q[1]<p[1])printf("Y e s\n");
			else if(q[1]==p[1]&&q[2]<=p[2])printf("Y e s\n");
			else if(q[1]==p[1]&&q[2]>p[2])printf("N o\n");
			else if(q[1]>p[1])printf("N o\n");
		}
	}
	}
	else {
		p[0]=0;
		if(q[0]-p[0]>=2){
		printf("N o\n");
	}
	else {
		if(q[0]==p[0])printf("Y e s\n");
		else if(q[0]!=p[0]){
			if(q[1]<p[1])printf("Y e s\n");
			else if(q[1]==p[1]&&q[2]<=p[2])printf("Y e s\n");
			else if(q[1]==p[1]&&q[2]>p[2])printf("N o\n");
			else if(q[1]>p[1])printf("N o\n");
		}
	}
	}
	return 0;
}