决定开始自己的usaco之旅~~~~
水题,就当时练练usaco的格式了~
/*
ID: rowanha3
LANG: C++
TASK: friday
*/
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{freopen("friday.in","r",stdin);freopen("friday.out","w",stdout);int s[10];int leap,n,i,j;memset(s,0,sizeof(s));cin>>n;leap=1;for(i=1900;i<=1900+n-1;i++){for(j=1;j<=12;j++){leap=leap+13-1;s[leap%7]++;if(j==2&&((i%100!=0&&i%4==0)||i%400==0)){leap=leap+day[j]-13+1+1;}elseleap=leap+day[j]-13+1;leap=leap%7;}}printf("%d",s[6]);for(i=0;i<6;i++){printf(" %d",s[i]);}printf("\n");fclose(stdin);fclose(stdout);return 0;
}