记录编号 |
108294 |
评测结果 |
AAAAAAAA |
题目名称 |
黑色星期五 |
最终得分 |
100 |
用户昵称 |
752199526 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.003 s |
提交时间 |
2014-07-03 18:36:28 |
内存使用 |
0.31 MiB |
显示代码纯文本
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include <cstdlib>
#include<cstring>
#include<cctype>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<cassert>
#include<algorithm>
#include<functional>
#include<ctime>
using namespace std;
ifstream fin("friday.in");
ofstream fout("friday.out");
typedef unsigned long long LL;
int init_days(int month,int year)
{
if(month==2)
{
if((year%4==0&&year%100!=0)||year%400==0)return 29;
return 28;
}
if(month==4||month==6||month==9||month==11)return 30;
return 31;
}
int main()
{
int n,week[8]={0},date=1;
fin>>n;
for(int year=1900;year<=1899+n;year++)
{
for(int month=1;month<=12;month++)
{
int days=init_days(month,year);
for(int day=1;day<=days;day++)
{
if(date==8)date=1;
if(day==13)week[date]++;
date++;
}
}
}
fout<<week[6]<<" "<<week[7]<<" "<<week[1]<<" "<<week[2]<<" "<<week[3]<<" "<<week[4]<<" "<<week[5]<<endl;
return 0;
}