0
已解决
林炜曦
中级守护
中级守护
WA70分
#include<iostream>
#include<ctime>
#include<cstdio>
using namespace std;
int ch[]={0,31,28,31,30,31,30,31,31,30,31,30,31},cnt;
bool check(int y,int m,int d){
return (m<=12&&m!=0&&d<=ch[m]&&d!=0);
}
int main(){
int date1,date2;
cin>>date1>>date2;
for(int y=date1/10000;y<=date2/10000;y++){
int d=y/100%10*10+y/1000;
int m=y%10*10+y/10%10;
int t=y*10000+m*100+d;
if(check(y,m,d)&&t>=date1&&t<=date2)
cnt++;
else
continue;
// cout<<y<<" "<<m<<' '<<d<<'\t'<<t<<"\n";
}
cout<<cnt;
return 0;
}
哪错了???????
林炜曦在2023-10-08 21:20:49追加了内容