日期问题
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
bool check(int year,int month,int day){
if(month < 0 || month > 12) return false;
if(day == 0 || month != 2 && day > days[month]) return false;
if(month == 2){
int leap = year % 100 && year % 4 == 0 || year % 400 == 0;
if(day > leap + 28) return false;
}
return true;
}
int main(){
int a,b,c;
scanf("%d/%d/%d",&a,&b,&c);
for(int data = 19600101;data <= 20591231;++data){
int year = data / 10000,month = data % 10000 / 100,day = data % 100;
if(check(year,month,day)){
if(year % 100 == a && month == b && day == c || month == a && day == b && year % 100 == c || day == a && month == b && year % 100 == c){
printf("%d-%02d-%02d\n",year,month,day);
}
}
}
return 0;
}