大佬救救我AC3个点其他WA
查看原帖
大佬救救我AC3个点其他WA
757902
lizerui520楼主2022/9/11 14:50

HELP

#include<bits/stdc++.h>
using namespace std;
int mou[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int ans[7];
int main()
{
	int n,i,y,now;
	cin>>n;
	now=13;
	for(y=1990;y<1990+n;y++)
	{
		for(i=1;i<=12;i++)
		{
			ans[now%7]++;
			int x=mou[i];
			if(i==2&&((y%4==0&&y%100!=0)||y%400==0))x++;
			now=now+x;
		}
		
	}
	for(int i=0;i<7;i++)
	{
		cout<<ans[(i+6)%7]<<" ";
	}
	return 0; 
}
2022/9/11 14:50
加载中...