Submission #22039

# Submission time Handle Problem Language Result Execution time Memory
22039 2017-04-29T03:42:11 Z test(#1004, lyzqm123) None (KRIII5P_1) C++14
7 / 7
3 ms 1116 KB
#include <cstdio>
int main(){
	int T;
	int month[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	char ans[2][10] = { "Yes", "No" };
	scanf("%d", &T);
	while (T--){
		int a, b;
		scanf("%d%d", &a, &b);
		if (a >= 0 && a <= 23 && b >= 0 && b <= 59) printf("%s ", ans[0]);
		else printf("%s ", ans[1]);

		if (a >= 1 && a <= 12) {
			if (b >= 1 && b <= month[a - 1]) printf("%s\n", ans[0]);
			else printf("%s\n", ans[1]);
		}
		else printf("%s\n", ans[1]);
	}
	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:9:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &a, &b);
                        ^
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1116 KB Output is correct