记录编号 |
558016 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
[CSP JX2019]日期(民间数据) |
最终得分 |
100 |
用户昵称 |
魔笛 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.000 s |
提交时间 |
2020-12-03 21:45:46 |
内存使用 |
0.00 MiB |
显示代码纯文本
- #include<iostream>
- #include<cstdio>
- using namespace std;
- int main(){
- freopen("2019jx_date.in","r",stdin);
- freopen("2019jx_date.out","w",stdout);
- char s;
- string q;
- cin>>q;
- int a,b,c,d,ans=0;
- a=q[0]-'0',b=q[1]-'0',c=q[3]-'0',d=q[4]-'0';
- if(a==0&&b==0&&c==0&&d==0){
- cout<<2;
- return 0;
- }
- if(a*10+b==1){ if(c*10+d>31)ans++;}
- else if(a*10+b==2) { if(c*10+d>28)ans++;}
- else if(a*10+b==3) { if(c*10+d>31)ans++;}
- else if(a*10+b==4) { if(c*10+d>30)ans++;}
- else if(a*10+b==5) { if(c*10+d>31)ans++;}
- else if(a*10+b==6) { if(c*10+d>30)ans++;}
- else if(a*10+b==7) { if(c*10+d>31)ans++;}
- else if(a*10+b==8) { if(c*10+d>31)ans++;}
- else if(a*10+b==9) { if(c*10+d>30)ans++;}
- else if(a*10+b==10) { if(c*10+d>31)ans++;}
- else if(a*10+b==11) { if(c*10+d>30)ans++;}
- else if(a*10+b==12) { if(c*10+d>31)ans++;}
- else{
- ans++;
- if(c*10+d>31)ans++;
- else if(c*10+d>28)ans++;
- else if(c*10+d>31)ans++;
- else if(c*10+d>30)ans++;
- else if(c*10+d>31)ans++;
- else if(c*10+d>30)ans++;
- else if(c*10+d>31)ans++;
- else if(c*10+d>31)ans++;
- else if(c*10+d>30)ans++;
- else if(c*10+d>31)ans++;
- else if(c*10+d>30)ans++;
- else if(c*10+d>31)ans++;
- }
- cout<<ans<<endl;
- return 0;
- }