bcbgszyzh @ 2023-09-09 10:41:23
为什么
#include<bits/stdc++.h>
using namespace std;
int DayNum[]={-1,31,28,31,30,31,30,31,31,30,31,30,31};
bool p(int x){
if( x%4==0 && x%100!=0|| x%400==0 )
return true;
else
return false;
}
int main(){
int a,b;
cin>>a>>b;
int cnt=0;
for(int i=a/10000;i<=b/10000;++i) {
if(p(i))DayNum[2]++;
int x=(i%10)*10+i/10%10,y=(i/100%10)*10+i/1000;
if(x>=1&&x<=12){
if(y>=1&&y<=DayNum[x]){
cnt++;
}
}
if(p(i))DayNum[2]--;
}
printf("%d",cnt);
return 0;
}
by bcbgszyzh @ 2023-09-09 10:41:49
WA100
样例 AC
by bcbgszyzh @ 2023-09-23 20:15:14