慕码人7586859
2018-08-15 17:05
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
month=month-1;
int day = 8;
int k;
switch(month)
case 1: k=31;
break;
case 2: k=28+31;
break;
case 3: k=31+28+31;
break;
case 4: k=30+31+28+31;
break;
case 5: k=31+30+31+28+31;
break;
case 6: k=30+31+30+31+28+31;
break;
case 7: k=31+30+31+30+31+28+31;
break;
case 8: k=31+31+30+31+30+31+28+31;
break;
case 9: k=30+31+31+30+31+30+31+28+31;
break;
case 10: k=31+30+31+31+30+31+30+31+28+31;
break;
if(year%400==0)
k=k+day+1;
else
k=k+day;
printf("%d",k);
return 0;
}
if((year%400==0)||(year%4==0&&year%100!=0))
C语言入门
926209 学习 · 20797 问题
相似问题
回答 3
回答 2
回答 3
回答 2
回答 2