为什么WA了三个点

P2010 [NOIP2016 普及组] 回文日期

AloneV @ 2019-08-11 22:57:04


#include<cstdlib>
#include<cmath>
#include<cstring>
#include<queue>
#include<iostream>
#include<algorithm>
using namespace std;
int a,b;
int m[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int n,sum;
int ans;
int main()
{
    cin>>a>>b;
    for (int i=1;i<=12;i++)
        {
            n=(j%10)*1000+(j/10)*100+(i%10)*10+(i/10);
            sum=n*10000+i*100+j;
            if ((sum<a)||(sum>b))   {continue;}
            ans++;
        }
    cout<<ans;
    return 0;
}

by AloneV @ 2019-08-11 23:05:31

不用了,我已经会了


|