_ALIVE_LYY @ 2017-10-22 21:45:28
个人觉得思路没有问题
#include<iostream>
#include<cstdio>
using namespace std;
int sum,x,y,temp,tempf,i,j;
int month[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int main()
{
scanf("%d%d",&x,&y);
for(i=1;i<=12;i++)
for(j=1;j<=month[i];j++)
{
temp=(j%10)*1000+(j/10)*100+(i%10)*10+(i/10);
tempf=temp*10000+i*100+j;
cout<<tempf<<" ";
if(tempf<x||temp>y) continue;
sum++;
}
printf("%d",sum);
return 0;
}
by ChthollyTree @ 2017-10-25 19:20:21
平年二月是28天,闰年是29天