CodeForces 760APetr and a calendar
来源:互联网 发布:如何做一名数据分析师 编辑:程序博客网 时间:2024/05/17 02:47
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;}
阅读全文
0 0
- CodeForces 760APetr and a calendar
- 【codeforces 760A】Petr and a calendar
- Codeforces 760A-Petr and a calendar
- CodeForces 760A Petr and a calendar
- Codeforces Round #393 Petr and a calendar
- cf 760A Petr and a calendar
- A. Petr and a calendar
- 【63.63%】【codeforces 724A】Checking the Calendar
- [codeforces]A. Checking the Calendar 水题
- Codeforces 724A. Checking the Calendar
- Codeforces 724A-Checking the Calendar
- CodeForces 724A Checking the Calendar
- codeforces Calendar
- codeforces A. Ciel and Robot
- codeforces --A - Sereja and Algorithm
- codeforces A. Vanya and Cards
- 【CODEFORCES】 A. Pashmak and Garden
- 【CodeForces】A. Mike and Frog
- MFC框架界面开发(一):视图和框架
- CF 376D. Maximum Submatrix 2 枚举+前缀和
- 数字图像处理之二维图像的傅里叶变换(2)
- HBase概念
- 第五周 项目3
- CodeForces 760APetr and a calendar
- 关于Integer类的学习
- JVM学习笔记(2)------JVM的内存结构
- SDUT-3363-数据结构实验之图论七:驴友计划
- 函数lower_bound()的使用
- Codeforces 711A Bus to Udayland
- javascript Date format(js日期格式化)
- 链表
- 内置函数 & UDF函数在Hive中的使用