求dalao看一下吧,就剩下2号点了,找不出错了

P5690 [CSP-S2019 江西] 日期

@[osky123456](/user/467616) ```cpp #include<bits/stdc++.h> using namespace std; int a1,b1,b2,a,b,ans,qwq[20]={0,31,28,31,30,31,30,31,31,30,31,30,31}; char n[5]; int main(){ scanf("%02d-%02d",&a,&b); if(a>12||a<=0){ ans++; if(a/10==1||a%10==2) a=12; else if(a%10==0) a=10; else a=a%10; } if(b>qwq[a]||b<=0) ans++; printf("%d\n",ans); return 0; } ```
by qwq___qaq @ 2021-10-04 23:28:16


是月份是十的倍数的问题,我也是这里出问题了
by KnownError_ @ 2021-10-06 13:26:33


|