当前位置:网站首页>Look for leap years and see how many leap years I have had since I was born (I have had five)

Look for leap years and see how many leap years I have had since I was born (I have had five)

2022-06-11 21:43:00 The chick is speechless

#include<stdio.h>
int main()
{
	int year;
	int count=0;
	printf(" Enter your year of birth :");
	scanf("%d",&year);
	for(year;year<=2022;year++)
	{
		if(year%4==0&&year%100!=0||year%400==0)
		{
			printf("%d\n",year);
			count++;
		}
	}
	printf("count=%d\n",count);
	return 0;
}

You can try !!

原网站

版权声明
本文为[The chick is speechless]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011653317534.html