解题思路:
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int month1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int month2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int year,i,month,day,count=0;
scanf("%d %d %d",&year,&month,&day);
if(year%4==0&&year%100!=0||year%400==0)
{
for(i=0;i<month-1;i++)
{
count=count+month2[i];
}
}
else
for(i=0;i<month-1;i++)
{
count=count+month1[i];
}
month1[0]=month2[0]=day;
printf("%d",count+day);
}
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题9.8 (Java代码)浏览:1666 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:434 |
Wu-求圆的面积 (C++代码)浏览:1987 |
【金明的预算方案】 (C++代码)浏览:869 |
【绝对值排序】 (C语言代码)浏览:890 |
母牛的故事 (C语言代码)浏览:1446 |
回文数字 (C语言代码)浏览:2532 |
剪刀石头布 (C++代码)浏览:1804 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:603 |
简单的a+b (C语言代码)浏览:668 |