답안 #22086

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
22086 2017-04-29T07:43:27 Z 삼*전자 그린픽스(#1005, pichulia) 시간과 날짜 (KRIII5P_1) C++
7 / 7
3 ms 1116 KB
#include<stdio.h>
int n, m;
int a[99] = { 0,31,29,31,30,31,30,31,31,30,31,30,31 };
int main() {
	int t;
	scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		int r1, r2;
		r1 = r2 = 0;
		if (n >= 0 && n < 24)
			if (m >= 0 && m < 60)
				r1 = 1;
		if (n > 0 && n <= 12)
			if (m > 0 && m <= a[n])
				r2 = 1;
		printf("%s %s\n", r1 ? "Yes" : "No", r2 ? "Yes" : "No");
	}
	return 0;
}

Compilation message

td.cpp: In function 'int main()':
td.cpp:6:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &t);
                 ^
td.cpp:8:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &n, &m);
                         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1116 KB Output is correct