这年的开始的第一天是星期 1
代码如下:
========================================================================================================
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iostream>
#include<math.h>
#include<string.h>
using namespace std; ///平年
int M[]={,,,,,,,,,,,,}; int Week(int date, int month)
{
int w=date; if(month> || month< || date< || date > M[month])
return -; for(int i=; i<month; i++)
w += M[i]; return (w%) ? (w%) : ;
} int main()
{
int date, month; scanf("%d%d", &date, &month); int w = Week(date, month); if(w < )
printf("Impossible\n");
else
printf("%d\n", w); return ;
}