http://codeforces.com/problemset/problem/760/A
给出2017年内的某一月,然后再给出第一天是星期几,求该月份在一页日历中需要多少列表示,因为第一天需要一列,然后将第一天到周日的全部剪掉。剩下的除以7即可。
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
int mo[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
while(cin>>n>>m)
{
int day=mo[n];
int ans=1;
if((day-(7-m+1))%7==0)
ans+=(day-(7-m+1))/7;
else ans+=(day-(7-m+1))/7+1;
cout<<ans<<endl;
}
return 0;
}