80分求助大佬
查看原帖
80分求助大佬
749831
Luogu_are_DASB楼主2023/8/16 16:11
#include <iostream>
using namespace std;
/*
Happy.Sun
*/
int n;
int m;
int month[13]={0,31,30,31,30,31,30,31,31,30,31,30,31};
int ans=0;
bool huiwen(int n){
	int y=n;
	int temp=0;
	while(y){
		temp*=10;
		temp+=y%10;
		y/=10;
	}
	if(temp==n) return 1;
	else  return 0;
}
int main(){
	cin>>n>>m;
	for(int i=n;i<=m;i++){
		if(!huiwen(i)) continue;
		int temp=i;
		int m=temp/100%100;
		if(m<=12&&month[m]>=temp%100){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}

2023/8/16 16:11
加载中...