Raeburn


私信TA

用户名:uq_17132611627

访问量:398

签 名:

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

  自我简介:

解题思路:  不知道为什么使用typedef答案就是错误,搞不懂,求大神解答。

注意事项:

参考代码:

#include<stdio.h> 

 

struct date{

int year;

int month;

int day;

};

int main(){

struct date temp;

int sum=0;

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

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

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

    month_num[1]=29;


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

sum+=month_num[i];

sum+=temp.day;


printf("%d",sum);

return 0;

}


 

0.0分

0 人评分

  评论区