记录编号 |
549390 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
[CSP JX2019]日期(民间数据) |
最终得分 |
100 |
用户昵称 |
锝镆氪锂铽 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.000 s |
提交时间 |
2020-02-10 19:28:26 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include<iostream>
#include<cstdio>
using namespace std;
int jx_(){
freopen("2019jx_date.in","r",stdin);
freopen("2019jx_date.out","w",stdout);
int m,d,ans=0;
scanf("%d-%d",&m,&d);
if(m%10==2&&m!=2){
if(m!=12)ans++;
if(d<1||d>31)ans++;
printf("%d",ans);
return 0;
}
if(m%10==1&&m!=1){
if(m!=11)ans++;
if(d<1||d>30)ans++;
printf("%d",ans);
return 0;
}
if(m%10==0){
if(m!=10)ans++;
if(d<1||d>31)ans++;
printf("%d",ans);
return 0;
}
if(m==2){
if(m!=2)ans++;
if(d>28)ans++;
printf("%d",ans);
return 0;
}
if(m>12){
ans++;
int m_=m%10;
if(m_==1||m_==3||m_==5||m_==7||m_==8||m_==10||m_==12){
d>31?ans++:ans=ans;
printf("%d",ans);
}
else if(m_==2)d>28?printf("2"):printf("1");
else d>30?printf("2"):printf("1");
}
else {
if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
d>31?ans++:ans=ans;
printf("%d",ans);
}
else if(m==2)d>28?printf("1"):printf("0");
else d>30?printf("1"):printf("0");
}
return 0;
}
int lol=jx_();
int main(void){;}