秋风


私信TA

用户名:19179792462

访问量:294

签 名:

等  级
排  名 49684
经  验 258
参赛次数 0
文章发表 1
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

简单暴力破解
浏览:242

解题思路:

注意事项:

参考代码:

#include<stdio.h>

int main()

{

    int month1[12]={31,28,31,30,31,30,31,31,30,31,30,31};

    int month2[12]={31,29,31,30,31,30,31,31,30,31,30,31};

    int year,i,month,day,count=0;

    scanf("%d %d %d",&year,&month,&day);

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

    {

        for(i=0;i<month-1;i++)

        {

            count=count+month2[i];

        }

    }

    else

        for(i=0;i<month-1;i++)

        {

            count=count+month1[i];

        }

       month1[0]=month2[0]=day;

    printf("%d",count+day); 

 } 


 

0.0分

1 人评分

  评论区