P1202!救我!
#include<bits/stdc++.h>
using namespace std;
int s[8];
bool rn(int x){
if((x%400==0)||(x%4==0&&x%100!=0)){
return true;
}
return false;
}
int main(){
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int y1=1900,m=1,d=1,w=1,n,y2;
cin>>n;
y2=1900+n-1;
while(!(y1==y2&&m==12&&d==31)){
w++;
d++;
if(w>7){
w=1;
}
if(d==13){
s[w+1]++;
}
if(rn(y1)&&m==2&&d>=30){
m++;
d=1;
}
else if(d>a[m]){
m++;
d=1;
}
if(m>12){
y1++;
m=1;
}
}
cout<<s[7]<<" "<<s[8]<<" "<<s[2]<<" "<<s[3]<<" "<<s[4]<<" "<<s[5]<<" "<<s[6]<<" ";
return 0;
}