文章
12
粉丝
10
获赞
1
访问
5.5k
#include<iostream>
using namespace std;
int days1[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};//闰年
int days2[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};//平年
int Judge(int x)
{
if(x%100==0)
if(x%400==0)return 1;
else return 0;
else if(x%4==0)return 1;
return 0;
}
int main()
{
int y,d;
while(cin>>y>>d)
{
int m = 1;//标记月份
if(Judge(y))
while(d>days1[m])
d-=days1[m++];
else
while(d>days2[m])
&n...
登录后发布评论
暂无评论,来抢沙发