私信TA

用户名:tjt777

访问量:4844

签 名:

人不活一个点,人活起伏

等  级
排  名 2137
经  验 2324
参赛次数 1
文章发表 10
年  龄 0
在职情况 学生
学  校 泰州学院
专  业 计算机科学与技术

  自我简介:

燃烧

TA的其他文章

高精度加法!
浏览:339

解题思路:

注意事项:注意for循环的控制条件

参考代码:

#include<stdio.h>
struct Date 
{
	int year;
	int mouth;
	int day;
} student1;
int main()
{
	int i,a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int sum=0;
	scanf("%d%d%d",&student1.year,&student1.mouth,&student1.day);
	sum=sum+student1.day;
	for(i=0;i<student1.mouth-1;i++)
		sum+=a[i];
	if(student1.year%400==0||(student1.year%4==0&&student1.year%100!=0))
		printf("%d",sum+1);
	else printf("%d",sum);
}


 

0.0分

0 人评分

  评论区