Submission #22132

# Submission time Handle Problem Language Result Execution time Memory
22132 2017-04-29T11:02:40 Z 나자바봐랑(#1023, devetude) None (KRIII5P_1) C
2 / 7
3 ms 1116 KB
#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) {
                day = (1 <= y && y <= 29 ? true : false);
            }
            
            else 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;
}

Compilation message

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 time Memory Grader output
1 Partially correct 3 ms 1116 KB Output is partially correct