1.1.3
来源:互联网 发布:vs2010是什么软件 编辑:程序博客网 时间:2024/05/21 09:07
/*ID:18861501LANG:C++TASK:friday*//*------------------Header Files------------------*/#include <iostream>#include <cstring>#include <string>#include <cstdio>#include <algorithm>#include <cstdlib>#include <ctype.h>#include <cmath>#include <stack>#include <queue>#include <map>#include <vector>#include <limits.h>using namespace std;/*------------------Definitions-------------------*/#define ll long long#define PI acos(-1.0)#define INF 0x3F3F3F3F/*---------------------Work-----------------------*/int daycount[10];bool is_leap(int year){if((year%4==0&&year%100!=0)||year%400==0)return true;return false;}void work(){int N;scanf("%d",&N);memset(daycount,0,sizeof(daycount));int weekday=2;for(int i=1900;i<=1900+N-1;i++){bool yearflag=is_leap(i);for(int j=1;j<=12;j++){daycount[(weekday+12)%7]++;switch(j){case 1:weekday=(weekday+30)%7;break;case 2:if(yearflag) weekday=(weekday+28)%7;else weekday=(weekday+27)%7;break;case 3:weekday=(weekday+30)%7;break;case 4:weekday=(weekday+29)%7;break;case 5:weekday=(weekday+30)%7;break;case 6:weekday=(weekday+29)%7;break;case 7:weekday=(weekday+30)%7;break;case 8:weekday=(weekday+30)%7;break;case 9:weekday=(weekday+29)%7;break;case 10:weekday=(weekday+30)%7;break;case 11:weekday=(weekday+29)%7;break;case 12:weekday=(weekday+30)%7;break;}if(weekday==6) weekday=0;else weekday++;}}for(int i=0;i<7;i++){if(i>0) printf(" ");printf("%d",daycount[i]);}printf("\n");}/*------------------Main Function------------------*/int main(){//freopen("test.txt","r",stdin);freopen("friday.out","w",stdout);freopen("friday.in","r",stdin);work();return 0;}
0 0
- 1.1.3
- [1.1.3] 人机界面简史
- 编译xvid 1.1.3
- Busybox 1.1.3编译
- 1.1.3检测题
- 算法导论1.1-3
- 练习1.1.3
- usaco 1.1.3 wormholes
- USACO 1.1 Problem 3
- usaco 1.1.3 friday
- 1.1.3 Hadoop生态系统
- HDU 1.1.3
- 1.1.3 memcachedb
- Iptables 指南 1.1.19 (3)
- 1.1.3 GIS应用框架
- AIX5.3上装python3.1.1
- 1.1.3 Friday the Thirteenth
- Ubuntu Gstreamer 1.1.3 编译
- Bug的严重等级和优先级
- 分布式搜索Elasticsearch——集成paoding-maping
- 1036. 跟奥巴马一起编程(15)
- HtmlUnit 模拟浏览器以及Cookie使用示例
- github 导入的类控件属性失效
- 1.1.3
- lucene-对多个索引的搜索和多线程搜索
- tika读取文件内容
- iOS应用程序状态切换相关
- lucene开发序幕曲之luke神器
- libevent源码深度剖析四
- ATS(iOS开发网络适配)一劳永逸的办法
- dubbo 协议分析,Hessian序列化分析
- 冒泡排序