你说它有什么功能呢
#include<iostream>
using namespace std;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
int n;
while(cin>>n)
{
int i,j,k,jj;
int b[8]={0,0,0,0,0,0,0};
for(i=1900;i<1900+n;i++)
{
if((i%4==0&&i%100!=0)||i%400==0)
a[2]=29;
for(k=1;k<=12;k++)
{
for(j;j+7<=a[k];)
j+=7;
jj=a[k]-j;
switch (jj+1)
{
case 1:b[6]++;break;
case 2:b[7]++;break;
case 3:b[1]++;break;
case 4:b[2]++;break;
case 5:b[3]++;break;
case 6:b[4]++;break;
case 7:b[5]++;break;
default:b[0]++;break;
}
j=7-jj;
}
}
for(i=1;i<=7;i++)
cout<<b[i]<<" ";
}
return 0;
}