记录编号 |
549353 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
[CSP JX2019]日期(民间数据) |
最终得分 |
100 |
用户昵称 |
夜莺 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.006 s |
提交时间 |
2020-02-09 22:40:02 |
内存使用 |
1.97 MiB |
显示代码纯文本
#include<cstdio>
using namespace std;
int main(){
int moon,day;
int moon_change[100]={1,1,2,3,4,5,6,7,8,9,10,1,12,12,12,12,12,12,12,12,10,1,12,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9},day_num[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
freopen("2019jx_date.in","r",stdin);
freopen("2019jx_date.out","w",stdout);
scanf("%d-%d",&moon,&day);
int ans=0;
if(day>day_num[moon_change[moon]]||day<1)ans++;
if(moon!=moon_change[moon]){
if(day_num[moon]<day||day<1)
ans++;
}
printf("%d",ans);
return 0;
}