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 a[3]={0},b[3]={0};
    int h,m,d,e,f,g;
    scanf("%d %d %d",&h,&m,&d);
    scanf("%d %d %d",&e,&f,&g);
        a[0]=h;
        a[1]=m;
        a[2]=d;
        b[0]=e;
        b[1]=f;
        b[2]=g;
    if((a[0] ==7)&&(b[0]==1)){
        a[0]=1;
        b[0]=2;
    }
    int c;
    if(a[0]==b[0]){
        c = b[1];
    }else{
    c = 24-a[1]+b[1];
    }
    if(((b[0]-a[0])!=1)&&((b[0]-a[0])!=0)){
        printf("N o\n");
    }else if(c>24){
        printf("N o\n");
    }else if(c==24){
        if(a[2]>=b[2]){
            printf("Y e s\n");
        }else{
            printf("N o\n");
        }
    }else{
        printf("Y e s\n");
    }
    return 0;
}