用int Dayo Year(int year,int month,int day);这个函数原型实现输入某年某月某
答案:1 悬赏:0 手机版
解决时间 2021-11-09 02:18
- 提问者网友:树红树绿
- 2021-11-08 13:37
用int Dayo Year(int year,int month,int day);这个函数原型实现输入某年某月某
最佳答案
- 五星知识达人网友:洒脱疯子
- 2021-11-08 14:08
int DayoYear(int year,int month,int day)
{int i,d,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
d=day;
if(year%4==0&year%100!=0||year%400==0)a[2]++;
for(i=1;i d+=a[i];
return d;
}追问您运行过吗?运行不成啊!追答#include "stdio.h"
int DayoYear(int year,int month,int day)
{int i,d,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
d=day;
if(year%4==0&year%100!=0||year%400==0)a[2]++;
for(i=1;i d+=a[i];
return d;
}
int main()
{int y,m,d;
scanf("%d%d%d",&y,&m,&d);
}
{int i,d,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
d=day;
if(year%4==0&year%100!=0||year%400==0)a[2]++;
for(i=1;i
return d;
}追问您运行过吗?运行不成啊!追答#include "stdio.h"
int DayoYear(int year,int month,int day)
{int i,d,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
d=day;
if(year%4==0&year%100!=0||year%400==0)a[2]++;
for(i=1;i
return d;
}
int main()
{int y,m,d;
scanf("%d%d%d",&y,&m,&d);
printf("%d
",DayoYear(y,m,d));
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯