yuungold @ 2022-05-27 13:57:49
#include<bits/stdc++.h>
using namespace std;
long long date1,date2,a,b[8],c=0;
int main(){
cin>>date1>>date2;
for(int i=date1;i<=date2;i++){
if(i%10000/100==1||i%10000/100==3||i%10000/100==5||i%10000/100==7||i%10000/100==8||i%10000/100==10||i%10000/100==12){
if(i%100==32){
i+=100;i-=31;
if(i%10000/100==13){
i+=10000;i-=1200;
}
}
}
else if(i%10000/100==2){
if(i/10000%100!=0&&i/10000%4==0||i/10000%400==0){
if(i%10==30){
i+=100;i-=29;
}
}
else{
if(i%10==29){
i+=100;i-=28;
}
}
}else{
if(i%100==31){
i+=100;i-=30;
}
}
a=i;
for(int j=7;j>=0;j--){
b[j]=a%10;
a/=10;
}
if(b[0]==b[7]&&b[1]==b[6]&&b[2]==b[5]&&b[3]==b[4]){
c++;
}
}
cout<<c<<endl;
return 0;
}
by Ethereal_Z @ 2022-05-27 14:39:25
2月份判断了吗