제출 #22131

#제출 시각아이디문제언어결과실행 시간메모리
22131나자바봐랑 (#42)시간과 날짜 (KRIII5P_1)C11
2 / 7
0 ms1116 KiB
#include <stdio.h>

typedef enum {false, true} bool;

int main(int argc, const char * argv[]) {
    int T;
    scanf("%d", &T);
    
    while(T-- > 0) {
        int x = 0;
        int y = 0;
        scanf("%d %d", &x, &y);
        
        bool hour = (0 <= x && x <= 23 ? true : false);
        bool minute = (0 <= y && y <= 59 ? true : false);
        bool month = (1 <= x && x <= 12 ? true : false);
        bool day = false;
        
        if(month) {
            if(x % 2 == 1 || x == 8) {
                day = (1 <= y && y <= 31 ? true : false);
            }
        
            else {
                day = (1 <= x && x <= 30 ? true : false);
            }
        }
        
        hour && minute ? printf("Yes ") : printf("No ");
        month && day ? printf("Yes\n") : printf("No\n");
    }
    
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

td.c: In function 'main':
td.c:7:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &T);
     ^
td.c:12:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &x, &y);
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...