Current location - Loan Platform Complete Network - Big data management - Big data month function
Big data month function
# include & ltstdio.h & gt

Intcount (int A [12], int B [12], int year, int month, int day)// define a counting function to calculate what day it is today, A [12], B [12].

{

The code is a little long, sorry, please add it if you have any questions, thank you.

int i,sum = 0;

If (year% 4 = = 0 & amp& amp year% 100! =0||year%400==0)// Judge whether it is a leap year. If so, make the following statement.

for(I = 0; I & ltmounthi++)

{

sum+= a[I];

}

other

for(I = 0; I & ltmounthi++)

{

sum+= b[I];

}

Total+= days;

Returns (the sum);

}

void main()

{

Int year, month, day, m;

int a[ 12]={3 1,29,3 1,30,3 1,30,3 1,30,3 1,30,3 1},b[ 12]={3 1,28,3 1

//a array is the number of days per month in leap year, and B array is the number of days per month in non-leap year.

Printf ("Please enter year, month and day \ n");

Scanf("%d, %d, %d ",& year & month & Day);

M = Count (A, B, Year, Month, Day);

printf("%d\n ",m);

}