#include<stdio.h>
#define btw(a,x,b) ((a)<=(x) && (x)<=(b))
int days[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int main(){
int t;
for(scanf("%d",&t);t--;){
int s, e;
scanf("%d%d", &s, &e);
printf(btw(0,s,23) && btw(0,e,59) ? "Yes " : "No ");
puts(btw(1,s,12) && btw(1,e,days[s]) ? "Yes" : "No");
}
return 0;
}
Compilation message
td.cpp: In function 'int main()':
td.cpp:8:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(scanf("%d",&t);t--;){
^
td.cpp:10:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &s, &e);
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1116 KB |
Output is correct |