760A 水
第一天单独一行
其余7天一行
问某月有多少行
......
/** @Date : 2017-04-02-21.35 * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : */ #include<bits/stdc++.h> #define LL long long #define PII pair #define MP(x, y) make_pair((x),(y)) #define fi first #define se second #define PB(x) push_back((x)) #define MMG(x) memset((x), -1,sizeof(x)) #define MMF(x) memset((x),0,sizeof(x)) #define MMI(x) memset((x), INF, sizeof(x)) using namespace std; const int INF = 0x3f3f3f3f; const int N = 1e5+20; const double eps = 1e-8; int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int main() { int m, d; cin >> m >> d; int cnt = 1; int ans = 0; while(cnt < a[m]) { cnt++; d++; if(d % 7 == 1) { ans++; } } printf("%d\n", ans + 1); return 0; }