解题思路:

注意事项:

参考代码:

#include<stdio.h>

#include<math.h>

int main()

{

int y,m,d,time=0;

int mon[12];

mon[1]=31,

mon[2]=0,

mon[3]=31,

mon[4]=30,

mon[5]=31,

mon[6]=30,

mon[7]=31,

mon[8]=31,

mon[9]=30,

mon[10]=31,

mon[11]=30,

mon[12]=31;

while(scanf("%d/%d/%d",&y,&m,&d)!=EOF)

    {

    if((y%4==0&&y%100!=0)||(y%400==0))

    mon[2]=29;

    else

    mon[2]=28;

    for(int i=1;i<m;i++)

    {

        time+=mon[i];

    }

    printf("%d\n",time+d);

    }

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区