#define ret_ok  0
#define ret_err 1

int a[] = {31, 28, 31, 30, 31, 30, 31,31, 30, 31, 30, 31};

int judge_day(int Year, int Month, int Day, int *result_day)
{
    int Total = 0;
    int i = 0;

    if( (((Year%400) == 0) || ((Year%4) == 0)) && ((Year %100) != 0))//假设是闰年,那么2月份为29天
    {
        a[1] = 29;
    }
    for(i=0;i<Month-1;i++)
    {
        Total += a[i];
    }
    Total += Day;
    *result_day = Total;

    return ret_ok;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-11-19
  • 2021-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-04
  • 2021-07-06
  • 2021-07-01
相关资源
相似解决方案