1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
ifstream fin("friday.in");
ofstream fout("friday.out");
int numYear, N, numDays=365, totalDays=0;
vector<int> monthDays(12);
vector<int> daysNum(7);
monthDays[0]=31, monthDays[1]=28, monthDays[2]=31, monthDays[3]=30, monthDays[4]=31, monthDays[5]=30, monthDays[6]=31, monthDays[7]=31, monthDays[8]=30, monthDays[9]=31, monthDays[10]=30, monthDays[11]=31,
fin>>N;
for (int j=0;j<N;j++)
{
if (N%4==0)
{
numDays++;
monthDays[1]=29;
if (N/100==0&&N/400!=0)
{
numDays--;
monthDays[1]=28;
}
}
for (int k=0;k<12;k++)
{
for (int l=0;l<monthDays[k];l++,totalDays++)
{
cout<<"\nl is "<<l<<"\ntotalDays is "<<totalDays;
if (l=13)
{
cout<<"\nl is"<<l;
int number=0;
number=totalDays%7;
daysNum[number]++;
}
}
}
}
for (int j=0;j<7;j++)
{
fout<<daysNum[j]<<" ";
}
fout<<"\n";
system ("PAUSE");
return 0;
}
|