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<stdlib.h>
#include<string.h>


int main() {
  int be[3];
  int to[3];

  for (int i = 0; i < 3; i++) {
    scanf("%d", &be[i]);
  }
  for (int i = 0; i < 3; i++) {
    scanf("%d", &to[i]);
  }

  if (be[0] > to[0]) {
    if (to[0] + 7 - be[0] > 1) {
      printf("N o");
    }
    else {
      if (to[1] + 24 - be[1] < 24) {
        printf("Y e s");
      }
      else if (to[1] + 24 - be[1] == 24) {
        if (to[2] > be[2]) {
          printf("N o");
        }
        else printf("Y e s");
      }
      else printf("N o");
    }
  }
  else if (to[0] - be[0] > 1) {
    printf("N o");
  }
  else if (to[0] - be[0] == 0) {
    printf("Y e s");
  }
  else {
    if (to[1] + 24 - be[1] < 24) {
      printf("Y e s");
    }
    else if (to[1] + 24 - be[1] == 24) {
      if (to[2] > be[2]) {
        printf("N o");
      }
      else printf("Y e s");
    }
    else printf("N o");
  }
}