回复 10楼 grmmylbs
我试了试,这两个都行
2016-03-24 16:42
2016-03-24 16:49
程序代码:#include <stdio.h>
int main()
{
int dayofmonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int day,month,year;
printf("Input year,month,day:");
scanf("%d,%d,%d",&year,&month,&day);
int i,total=day;
for(i=1;i<month;i++)
{
total+=dayofmonth[i];
}
if(year%400==0||(year%4==0&&year%100!=0))
{
if(month>2) total+=1;
}
printf("It is the %dth day of the year\n",total);
return 0;
}[此贴子已经被作者于2016-3-25 15:22编辑过]

2016-03-24 16:51
2016-03-24 16:55
2016-03-24 16:59
2016-03-24 17:00
2016-03-24 17:00
2016-03-24 17:12

[此贴子已经被作者于2016-3-25 15:07编辑过]
2016-03-25 15:06
2016-03-25 16:50