답안 #22133

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
22133 2017-04-29T11:02:50 Z SCIK(#1022, SCIK) 시간과 날짜 (KRIII5P_1) C++11
0 / 7
3 ms 1116 KB
//
//  main.cpp
//  r
//
//  Created by 수익 조 on 2017. 4. 29..
//  Copyright © 2017년 수익 조. All rights reserved.
//
#include <stdio.h>

int main(void) {
    int testcase = 0;
    scanf("%d", &testcase);
    
    while(testcase--) {
        int x = 0;
        int y = 0;
        scanf("%d %d", &x, &y);
        
        if(x < 24 && y < 60) printf("YES ");
        else printf("NO ");
        
        if(x == 1 || x == 3 || x == 5 || x == 7|| x == 8 || x == 10 || x == 12) {
            if(y >= 1 && y <= 31) printf("YES\n");
            else printf("NO\n");
        }
        
        else if( x == 4 || x == 6 || x == 9 || x == 11) {
            if(y >= 1 && y <= 30) printf("YES\n");
            else printf("NO\n");
        }
        
        else if(x == 2) {
            if( y >= 1 && y <= 29) printf("YES\n");
            else printf("NO\n");
        }
        
        else printf("NO\n");
    }
    
    return 0;
}

Compilation message

td.cpp: In function 'int main()':
td.cpp:12:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &testcase);
                           ^
td.cpp:17:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &x, &y);
                               ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 1116 KB Output isn't correct