解题思路:
注意事项:
参考代码:
#include<stdio.h>
typedef struct{
int year,month,date;
}time;
int sum(int year, int month, int date)
{
int num[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int sn=0;
for(int i=0; i<month-1; i++)
{
sn += num[i];
}
sn += date;
if(year%400==0 && month>2) sn += 1;
return sn;
}
int main()
{
time days;
int day;//该年第几天
scanf("%d %d %d", &days.year, &days.month, &days.date);
day=sum(days.year,days.month,days.date);
printf("%d\n", day);
return 0;
}
0.0分
1 人评分
wu-淘淘的名单 (C++代码)浏览:1339 |
用筛法求之N内的素数。 (C语言代码)浏览:807 |
The 3n + 1 problem (C语言代码)浏览:554 |
1025题解浏览:738 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:1270 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:609 |
字符串的修改 (C语言代码)浏览:1143 |
【出圈】 (C语言代码)浏览:979 |
A+B for Input-Output Practice (I) (C++代码)浏览:629 |
WU-震宇大神的杀毒软件 (C++代码)浏览:854 |