程序代码:
void main() { int day,month,year,sum,leap; printf("\nplease input year,month,day\n"); scanf("%d,%d,%d",&year,&month,&day); sum=0; switch(month) { case 12:sum=sum+30; case 11:sum=sum+31; case 10:sum=sum+30; case 9:sum=sum+31; case 8:sum=sum+30; case 7:sum=sum+31; case 6:sum=sum+30; case 5:sum=sum+31; case 4:sum=sum+30; case 3:sum=sum+28; case 2:sum=sum+31; case 1:sum=sum+day;break; default:printf("data error"); } if(year%400==0||(year%4==0&&year%100!=0)) leap=1; else leap=0; if(leap==1&&month>2) sum++; printf("it is the %dth day.",sum);}这个很有创意吧
认认真真的学习,踏踏实实的走路:戒骄戒躁!!!