Submission #22039

#TimeUsernameProblemLanguageResultExecution timeMemory
22039test (#42)시간과 날짜 (KRIII5P_1)C++14
7 / 7
3 ms1116 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...