1

噢莫加纳加加加  •  2天前


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, n2, ans = 0;
	int m[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	cin >> n >> n2;
	for (int i = 1; i <= 12; i++) {
		for (int j = 1; j <= m[i]; j++) {
			int year = (j % 10) * 1000 + (j / 10) * 100 + (i % 10) * 10 + (i / 10);
			int date = year * 10000 + i * 100 + j;
			if (date >= n && date <= n2) {
				ans++;
			}
		}
	}
	cout << ans;
	return 0;
}

评论:

请先登录,才能进行评论