hly_hly @ 2016-11-26 23:10:38
#include<cstdio>
#include<iostream>
#include<algorithm>
int a,b,i,j,k,l,y1,y2,m1,m2,d1,d2,s,sum;
int t[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int fz(int x)
{
int k=0,ans=0;
while(x>0){
k=x%10;
ans=ans*10+k;
x/=10;
}
return ans;
}
int pd(int x){
if((x%4==0 && x%100!=0)||x%400==0)return 1;
return 0;
}
using namespace std;
int main()
{
scanf("%d%d",&a,&b);
printf("%d\n%d\n",fz(a),fz(b));
while(a<=b){
y1=a/10000;
m1=a/100%100;
d1=a%100;
if(a==fz(a))sum++;
if(pd(y1)==1)t[3]=29;
else t[3]=28;
if(d1<t[m1])
a++;
else if(d1==t[m1]&&m1<12)
a=a-t[m1]+1+100;
else if(d1==t[m1]&&m1==12)
a=a-t[m1]+1-1200+100+10000;
}
printf("%d",sum);
return 0;
}
by coffee_gf @ 2016-12-10 10:03:18
因为洛谷这里是民间数据
by TvTw @ 2016-12-13 21:41:00
你别忘了。。复赛它运行的时间是有限制的。。。